From 5c9caf79ed311a28792da9e03b8a073279105b84 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 7 Mar 2023 14:16:20 +0800 Subject: [PATCH 01/11] New Resource: azurerm_cosmosdb_mongo_user_definition --- internal/services/cosmos/client/client.go | 6 + ...cosmosdb_mongo_user_definition_resource.go | 327 +++ internal/services/cosmos/registration.go | 1 + .../cosmosdb/2022-11-15/cosmosdb/README.md | 1892 +++++++++++++++++ .../cosmosdb/2022-11-15/cosmosdb/client.go | 18 + .../cosmosdb/2022-11-15/cosmosdb/constants.go | 824 +++++++ .../cosmosdb/id_cassandrakeyspace.go | 140 ++ .../cosmosdb/id_cassandrakeyspacetable.go | 153 ++ .../cosmosdb/id_clientencryptionkey.go | 153 ++ .../2022-11-15/cosmosdb/id_collection.go | 153 ++ .../id_collectionpartitionkeyrangeid.go | 179 ++ .../2022-11-15/cosmosdb/id_container.go | 153 ++ .../2022-11-15/cosmosdb/id_database.go | 140 ++ .../2022-11-15/cosmosdb/id_databaseaccount.go | 127 ++ .../cosmosdb/id_databaseaccountname.go | 101 + .../cosmosdb/id_databasecollection.go | 166 ++ .../cosmosdb/2022-11-15/cosmosdb/id_graph.go | 153 ++ .../2022-11-15/cosmosdb/id_gremlindatabase.go | 140 ++ .../2022-11-15/cosmosdb/id_location.go | 114 + .../2022-11-15/cosmosdb/id_mongodbdatabase.go | 140 ++ .../cosmosdb/id_mongodbdatabasecollection.go | 153 ++ .../cosmosdb/id_partitionkeyrangeid.go | 166 ++ .../cosmosdb/2022-11-15/cosmosdb/id_region.go | 140 ++ .../cosmosdb/id_sourceregiontargetregion.go | 153 ++ .../2022-11-15/cosmosdb/id_sqldatabase.go | 140 ++ .../2022-11-15/cosmosdb/id_storedprocedure.go | 166 ++ .../cosmosdb/2022-11-15/cosmosdb/id_table.go | 140 ++ .../2022-11-15/cosmosdb/id_targetregion.go | 140 ++ .../2022-11-15/cosmosdb/id_trigger.go | 166 ++ .../cosmosdb/id_userdefinedfunction.go | 166 ++ ...screateupdatecassandrakeyspace_autorest.go | 79 + ...rcescreateupdatecassandratable_autorest.go | 79 + ...sourcesdeletecassandrakeyspace_autorest.go | 78 + ...aresourcesdeletecassandratable_autorest.go | 78 + ...aresourcesgetcassandrakeyspace_autorest.go | 68 + ...getcassandrakeyspacethroughput_autorest.go | 69 + ...ndraresourcesgetcassandratable_autorest.go | 68 + ...cesgetcassandratablethroughput_autorest.go | 69 + ...esourceslistcassandrakeyspaces_autorest.go | 69 + ...raresourceslistcassandratables_autorest.go | 69 + ...tecassandrakeyspacetoautoscale_autorest.go | 78 + ...ndrakeyspacetomanualthroughput_autorest.go | 78 + ...gratecassandratabletoautoscale_autorest.go | 78 + ...ssandratabletomanualthroughput_autorest.go | 78 + ...atecassandrakeyspacethroughput_autorest.go | 79 + ...updatecassandratablethroughput_autorest.go | 79 + ...ollectionlistmetricdefinitions_autorest.go | 69 + .../method_collectionlistmetrics_autorest.go | 98 + .../method_collectionlistusages_autorest.go | 98 + ...collectionpartitionlistmetrics_autorest.go | 98 + ..._collectionpartitionlistusages_autorest.go | 98 + ...tionpartitionregionlistmetrics_autorest.go | 98 + ...od_collectionregionlistmetrics_autorest.go | 98 + ...tabaseaccountregionlistmetrics_autorest.go | 98 + ...atabaseaccountschecknameexists_autorest.go | 66 + ...databaseaccountscreateorupdate_autorest.go | 79 + .../method_databaseaccountsdelete_autorest.go | 78 + ...accountsfailoverprioritychange_autorest.go | 79 + .../method_databaseaccountsget_autorest.go | 68 + ...atabaseaccountsgetreadonlykeys_autorest.go | 69 + .../method_databaseaccountslist_autorest.go | 70 + ...aseaccountslistbyresourcegroup_autorest.go | 70 + ...eaccountslistconnectionstrings_autorest.go | 69 + ...ethod_databaseaccountslistkeys_autorest.go | 69 + ...eaccountslistmetricdefinitions_autorest.go | 69 + ...od_databaseaccountslistmetrics_autorest.go | 98 + ...tabaseaccountslistreadonlykeys_autorest.go | 69 + ...hod_databaseaccountslistusages_autorest.go | 98 + ..._databaseaccountsofflineregion_autorest.go | 79 + ...d_databaseaccountsonlineregion_autorest.go | 79 + ..._databaseaccountsregeneratekey_autorest.go | 79 + .../method_databaseaccountsupdate_autorest.go | 79 + ..._databaselistmetricdefinitions_autorest.go | 69 + .../method_databaselistmetrics_autorest.go | 98 + .../method_databaselistusages_autorest.go | 98 + ...cescreateupdategremlindatabase_autorest.go | 79 + ...ourcescreateupdategremlingraph_autorest.go | 79 + ...resourcesdeletegremlindatabase_autorest.go | 78 + ...linresourcesdeletegremlingraph_autorest.go | 78 + ...linresourcesgetgremlindatabase_autorest.go | 68 + ...esgetgremlindatabasethroughput_autorest.go | 69 + ...remlinresourcesgetgremlingraph_autorest.go | 68 + ...urcesgetgremlingraphthroughput_autorest.go | 69 + ...nresourceslistgremlindatabases_autorest.go | 69 + ...mlinresourceslistgremlingraphs_autorest.go | 69 + ...rategremlindatabasetoautoscale_autorest.go | 78 + ...mlindatabasetomanualthroughput_autorest.go | 78 + ...migrategremlingraphtoautoscale_autorest.go | 78 + ...gremlingraphtomanualthroughput_autorest.go | 78 + ...pdategremlindatabasethroughput_autorest.go | 79 + ...esupdategremlingraphthroughput_autorest.go | 79 + .../cosmosdb/method_locationsget_autorest.go | 68 + .../cosmosdb/method_locationslist_autorest.go | 70 + ...screateupdatemongodbcollection_autorest.go | 79 + ...cescreateupdatemongodbdatabase_autorest.go | 79 + ...sourcesdeletemongodbcollection_autorest.go | 78 + ...resourcesdeletemongodbdatabase_autorest.go | 78 + ...bresourcesgetmongodbcollection_autorest.go | 68 + ...getmongodbcollectionthroughput_autorest.go | 69 + ...odbresourcesgetmongodbdatabase_autorest.go | 68 + ...esgetmongodbdatabasethroughput_autorest.go | 69 + ...esourceslistmongodbcollections_autorest.go | 69 + ...bresourceslistmongodbdatabases_autorest.go | 69 + ...temongodbcollectiontoautoscale_autorest.go | 78 + ...dbcollectiontomanualthroughput_autorest.go | 78 + ...ratemongodbdatabasetoautoscale_autorest.go | 78 + ...godbdatabasetomanualthroughput_autorest.go | 78 + ...atemongodbcollectionthroughput_autorest.go | 79 + ...pdatemongodbdatabasethroughput_autorest.go | 79 + ...partitionkeyrangeidlistmetrics_autorest.go | 98 + ...ionkeyrangeidregionlistmetrics_autorest.go | 98 + .../method_percentilelistmetrics_autorest.go | 98 + ...centilesourcetargetlistmetrics_autorest.go | 98 + ...od_percentiletargetlistmetrics_autorest.go | 98 + ...reateupdateclientencryptionkey_autorest.go | 79 + ...ourcescreateupdatesqlcontainer_autorest.go | 79 + ...sourcescreateupdatesqldatabase_autorest.go | 79 + ...createupdatesqlstoredprocedure_autorest.go | 79 + ...esourcescreateupdatesqltrigger_autorest.go | 79 + ...teupdatesqluserdefinedfunction_autorest.go | 79 + ...sqlresourcesdeletesqlcontainer_autorest.go | 78 + ..._sqlresourcesdeletesqldatabase_autorest.go | 78 + ...ourcesdeletesqlstoredprocedure_autorest.go | 78 + ...d_sqlresourcesdeletesqltrigger_autorest.go | 78 + ...esdeletesqluserdefinedfunction_autorest.go | 78 + ...esourcesgetclientencryptionkey_autorest.go | 68 + ...od_sqlresourcesgetsqlcontainer_autorest.go | 68 + ...urcesgetsqlcontainerthroughput_autorest.go | 69 + ...hod_sqlresourcesgetsqldatabase_autorest.go | 68 + ...ourcesgetsqldatabasethroughput_autorest.go | 69 + ...resourcesgetsqlstoredprocedure_autorest.go | 68 + ...thod_sqlresourcesgetsqltrigger_autorest.go | 68 + ...urcesgetsqluserdefinedfunction_autorest.go | 68 + ...ourceslistclientencryptionkeys_autorest.go | 69 + ..._sqlresourceslistsqlcontainers_autorest.go | 69 + ...d_sqlresourceslistsqldatabases_autorest.go | 69 + ...sourceslistsqlstoredprocedures_autorest.go | 69 + ...od_sqlresourceslistsqltriggers_autorest.go | 69 + ...ceslistsqluserdefinedfunctions_autorest.go | 69 + ...migratesqlcontainertoautoscale_autorest.go | 78 + ...sqlcontainertomanualthroughput_autorest.go | 78 + ...smigratesqldatabasetoautoscale_autorest.go | 78 + ...esqldatabasetomanualthroughput_autorest.go | 78 + ...esupdatesqlcontainerthroughput_autorest.go | 79 + ...cesupdatesqldatabasethroughput_autorest.go | 79 + ...ableresourcescreateupdatetable_autorest.go | 79 + ...thod_tableresourcesdeletetable_autorest.go | 78 + .../method_tableresourcesgettable_autorest.go | 68 + ...bleresourcesgettablethroughput_autorest.go | 69 + ...ethod_tableresourceslisttables_autorest.go | 69 + ...sourcesmigratetabletoautoscale_autorest.go | 78 + ...migratetabletomanualthroughput_autorest.go | 78 + ...resourcesupdatetablethroughput_autorest.go | 79 + .../cosmosdb/model_accountkeymetadata.go | 26 + .../model_analyticalstorageconfiguration.go | 8 + .../cosmosdb/model_apiproperties.go | 8 + .../cosmosdb/model_autoscalesettings.go | 8 + .../model_autoscalesettingsresource.go | 10 + .../model_autoupgradepolicyresource.go | 8 + .../2022-11-15/cosmosdb/model_backuppolicy.go | 56 + .../model_backuppolicymigrationstate.go | 28 + .../2022-11-15/cosmosdb/model_capability.go | 8 + .../2022-11-15/cosmosdb/model_capacity.go | 8 + ...cassandrakeyspacecreateupdateparameters.go | 13 + ...cassandrakeyspacecreateupdateproperties.go | 9 + .../model_cassandrakeyspacegetproperties.go | 9 + .../model_cassandrakeyspacegetresults.go | 13 + .../model_cassandrakeyspacelistresult.go | 8 + .../model_cassandrakeyspaceresource.go | 8 + .../cosmosdb/model_cassandrapartitionkey.go | 8 + .../cosmosdb/model_cassandraschema.go | 10 + ...el_cassandratablecreateupdateparameters.go | 13 + ...el_cassandratablecreateupdateproperties.go | 9 + .../model_cassandratablegetproperties.go | 9 + .../model_cassandratablegetresults.go | 13 + .../model_cassandratablelistresult.go | 8 + .../cosmosdb/model_cassandratableresource.go | 11 + .../model_clientencryptionincludedpath.go | 11 + ...ientencryptionkeycreateupdateparameters.go | 8 + ...ientencryptionkeycreateupdateproperties.go | 8 + .../model_clientencryptionkeygetproperties.go | 8 + .../model_clientencryptionkeygetresults.go | 11 + .../model_clientencryptionkeyresource.go | 11 + .../model_clientencryptionkeyslistresult.go | 8 + .../cosmosdb/model_clientencryptionpolicy.go | 9 + .../2022-11-15/cosmosdb/model_clusterkey.go | 9 + .../2022-11-15/cosmosdb/model_column.go | 9 + .../cosmosdb/model_compositepath.go | 9 + .../model_conflictresolutionpolicy.go | 10 + .../cosmosdb/model_consistencypolicy.go | 10 + .../cosmosdb/model_containerpartitionkey.go | 11 + .../model_continuousmodebackuppolicy.go | 41 + .../2022-11-15/cosmosdb/model_corspolicy.go | 12 + .../cosmosdb/model_createupdateoptions.go | 9 + .../model_databaseaccountconnectionstring.go | 9 + ...l_databaseaccountcreateupdateparameters.go | 19 + ...l_databaseaccountcreateupdateproperties.go | 96 + .../model_databaseaccountgetproperties.go | 110 + .../model_databaseaccountgetresults.go | 21 + .../model_databaseaccountkeysmetadata.go | 11 + ...abaseaccountlistconnectionstringsresult.go | 8 + .../model_databaseaccountlistkeysresult.go | 11 + ...l_databaseaccountlistreadonlykeysresult.go | 9 + ..._databaseaccountregeneratekeyparameters.go | 8 + .../model_databaseaccountslistresult.go | 8 + .../model_databaseaccountupdateparameters.go | 15 + .../model_databaseaccountupdateproperties.go | 90 + .../cosmosdb/model_databaserestoreresource.go | 9 + .../2022-11-15/cosmosdb/model_excludedpath.go | 8 + .../cosmosdb/model_failoverpolicies.go | 8 + .../cosmosdb/model_failoverpolicy.go | 10 + ...l_gremlindatabasecreateupdateparameters.go | 13 + ...l_gremlindatabasecreateupdateproperties.go | 9 + .../model_gremlindatabasegetproperties.go | 9 + .../model_gremlindatabasegetresults.go | 13 + .../model_gremlindatabaselistresult.go | 8 + .../cosmosdb/model_gremlindatabaseresource.go | 8 + .../model_gremlindatabaserestoreresource.go | 9 + ...odel_gremlingraphcreateupdateparameters.go | 13 + ...odel_gremlingraphcreateupdateproperties.go | 9 + .../model_gremlingraphgetproperties.go | 9 + .../cosmosdb/model_gremlingraphgetresults.go | 13 + .../cosmosdb/model_gremlingraphlistresult.go | 8 + .../cosmosdb/model_gremlingraphresource.go | 14 + .../2022-11-15/cosmosdb/model_includedpath.go | 9 + .../2022-11-15/cosmosdb/model_indexes.go | 10 + .../cosmosdb/model_indexingpolicy.go | 13 + .../cosmosdb/model_ipaddressorrange.go | 8 + .../cosmosdb/model_keywrapmetadata.go | 11 + .../2022-11-15/cosmosdb/model_location.go | 13 + .../cosmosdb/model_locationgetresult.go | 11 + .../cosmosdb/model_locationlistresult.go | 8 + .../cosmosdb/model_locationproperties.go | 10 + .../2022-11-15/cosmosdb/model_metric.go | 43 + .../cosmosdb/model_metricavailability.go | 9 + .../cosmosdb/model_metricdefinition.go | 12 + .../model_metricdefinitionslistresult.go | 8 + .../cosmosdb/model_metriclistresult.go | 8 + .../2022-11-15/cosmosdb/model_metricname.go | 9 + .../2022-11-15/cosmosdb/model_metricvalue.go | 31 + ...mongodbcollectioncreateupdateparameters.go | 13 + ...mongodbcollectioncreateupdateproperties.go | 9 + .../model_mongodbcollectiongetproperties.go | 9 + .../model_mongodbcollectiongetresults.go | 13 + .../model_mongodbcollectionlistresult.go | 8 + .../model_mongodbcollectionresource.go | 11 + ...l_mongodbdatabasecreateupdateparameters.go | 13 + ...l_mongodbdatabasecreateupdateproperties.go | 9 + .../model_mongodbdatabasegetproperties.go | 9 + .../model_mongodbdatabasegetresults.go | 13 + .../model_mongodbdatabaselistresult.go | 8 + .../cosmosdb/model_mongodbdatabaseresource.go | 8 + .../2022-11-15/cosmosdb/model_mongoindex.go | 9 + .../cosmosdb/model_mongoindexkeys.go | 8 + .../cosmosdb/model_mongoindexoptions.go | 9 + .../cosmosdb/model_optionsresource.go | 9 + .../cosmosdb/model_partitionmetric.go | 45 + .../model_partitionmetriclistresult.go | 8 + .../cosmosdb/model_partitionusage.go | 14 + .../cosmosdb/model_partitionusagesresult.go | 8 + .../cosmosdb/model_percentilemetric.go | 43 + .../model_percentilemetriclistresult.go | 8 + .../cosmosdb/model_percentilemetricvalue.go | 38 + .../model_periodicmodebackuppolicy.go | 42 + .../cosmosdb/model_periodicmodeproperties.go | 10 + .../model_privateendpointconnection.go | 11 + ...del_privateendpointconnectionproperties.go | 11 + .../cosmosdb/model_privateendpointproperty.go | 8 + ...ivatelinkserviceconnectionstateproperty.go | 10 + .../cosmosdb/model_regionforonlineoffline.go | 8 + .../cosmosdb/model_restoreparameters.go | 31 + .../2022-11-15/cosmosdb/model_spatialspec.go | 9 + ...odel_sqlcontainercreateupdateparameters.go | 13 + ...odel_sqlcontainercreateupdateproperties.go | 9 + .../model_sqlcontainergetproperties.go | 9 + .../cosmosdb/model_sqlcontainergetresults.go | 13 + .../cosmosdb/model_sqlcontainerlistresult.go | 8 + .../cosmosdb/model_sqlcontainerresource.go | 15 + ...model_sqldatabasecreateupdateparameters.go | 13 + ...model_sqldatabasecreateupdateproperties.go | 9 + .../model_sqldatabasegetproperties.go | 9 + .../model_sqldatabasegetpropertiesresource.go | 13 + .../cosmosdb/model_sqldatabasegetresults.go | 13 + .../cosmosdb/model_sqldatabaselistresult.go | 8 + .../cosmosdb/model_sqldatabaseresource.go | 8 + ...qlstoredprocedurecreateupdateparameters.go | 13 + ...qlstoredprocedurecreateupdateproperties.go | 9 + .../model_sqlstoredproceduregetproperties.go | 8 + .../model_sqlstoredproceduregetresults.go | 13 + .../model_sqlstoredprocedurelistresult.go | 8 + .../model_sqlstoredprocedureresource.go | 9 + .../model_sqltriggercreateupdateparameters.go | 13 + .../model_sqltriggercreateupdateproperties.go | 9 + .../cosmosdb/model_sqltriggergetproperties.go | 8 + .../cosmosdb/model_sqltriggergetresults.go | 13 + .../cosmosdb/model_sqltriggerlistresult.go | 8 + .../cosmosdb/model_sqltriggerresource.go | 11 + ...erdefinedfunctioncreateupdateparameters.go | 13 + ...erdefinedfunctioncreateupdateproperties.go | 9 + ...del_sqluserdefinedfunctiongetproperties.go | 8 + .../model_sqluserdefinedfunctiongetresults.go | 13 + .../model_sqluserdefinedfunctionlistresult.go | 8 + .../model_sqluserdefinedfunctionresource.go | 9 + .../model_tablecreateupdateparameters.go | 13 + .../model_tablecreateupdateproperties.go | 9 + .../cosmosdb/model_tablegetproperties.go | 9 + .../cosmosdb/model_tablegetresults.go | 13 + .../cosmosdb/model_tablelistresult.go | 8 + .../cosmosdb/model_tableresource.go | 8 + .../model_throughputpolicyresource.go | 9 + .../model_throughputsettingsgetproperties.go | 8 + .../model_throughputsettingsgetresults.go | 13 + .../model_throughputsettingsresource.go | 11 + ...odel_throughputsettingsupdateparameters.go | 13 + ...odel_throughputsettingsupdateproperties.go | 8 + .../2022-11-15/cosmosdb/model_uniquekey.go | 8 + .../cosmosdb/model_uniquekeypolicy.go | 8 + .../2022-11-15/cosmosdb/model_usage.go | 12 + .../2022-11-15/cosmosdb/model_usagesresult.go | 8 + .../cosmosdb/model_virtualnetworkrule.go | 9 + .../cosmosdb/2022-11-15/cosmosdb/version.go | 12 + .../cosmosdb/2022-11-15/mongorbacs/README.md | 142 ++ .../cosmosdb/2022-11-15/mongorbacs/client.go | 18 + .../2022-11-15/mongorbacs/constants.go | 34 + .../mongorbacs/id_databaseaccount.go | 127 ++ .../mongorbacs/id_mongodbroledefinition.go | 140 ++ .../mongorbacs/id_mongodbuserdefinition.go | 140 ++ ...reateupdatemongoroledefinition_autorest.go | 79 + ...reateupdatemongouserdefinition_autorest.go | 79 + ...urcesdeletemongoroledefinition_autorest.go | 78 + ...urcesdeletemongouserdefinition_autorest.go | 78 + ...esourcesgetmongoroledefinition_autorest.go | 68 + ...esourcesgetmongouserdefinition_autorest.go | 68 + ...ourceslistmongoroledefinitions_autorest.go | 69 + ...ourceslistmongouserdefinitions_autorest.go | 69 + ...ngoroledefinitioncreateupdateparameters.go | 8 + .../model_mongoroledefinitiongetresults.go | 11 + .../model_mongoroledefinitionlistresult.go | 8 + .../model_mongoroledefinitionresource.go | 12 + ...ngouserdefinitioncreateupdateparameters.go | 8 + .../model_mongouserdefinitiongetresults.go | 11 + .../model_mongouserdefinitionlistresult.go | 8 + .../model_mongouserdefinitionresource.go | 13 + .../2022-11-15/mongorbacs/model_privilege.go | 9 + .../mongorbacs/model_privilegeresource.go | 9 + .../2022-11-15/mongorbacs/model_role.go | 9 + .../cosmosdb/2022-11-15/mongorbacs/version.go | 12 + vendor/modules.txt | 2 + 348 files changed, 19678 insertions(+) create mode 100644 internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccountname.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandrakeyspace_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandratable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandrakeyspace_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandratable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspace_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspacethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratablethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandrakeyspaces_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandratables_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandrakeyspacethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandratablethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetricdefinitions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistusages_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistusages_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionregionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionregionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountregionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountschecknameexists_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsfailoverprioritychange_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsgetreadonlykeys_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistbyresourcegroup_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistconnectionstrings_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistkeys_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetricdefinitions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistreadonlykeys_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistusages_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsofflineregion_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsonlineregion_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsregeneratekey_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetricdefinitions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistusages_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlindatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlingraph_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlindatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlingraph_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraph_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraphthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlindatabases_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlingraphs_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlindatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlingraphthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbcollection_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbdatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbcollection_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbdatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollection_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollectionthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbcollections_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbdatabases_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbcollectionthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbdatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidregionlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilelistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilesourcetargetlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentiletargetlistmetrics_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdateclientencryptionkey_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlcontainer_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqldatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlstoredprocedure_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqltrigger_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqluserdefinedfunction_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlcontainer_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqldatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlstoredprocedure_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqltrigger_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqluserdefinedfunction_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetclientencryptionkey_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainer_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainerthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabase_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlstoredprocedure_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqltrigger_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqluserdefinedfunction_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistclientencryptionkeys_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlcontainers_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqldatabases_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlstoredprocedures_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqltriggers_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqluserdefinedfunctions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqlcontainerthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqldatabasethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcescreateupdatetable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesdeletetable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettable_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettablethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourceslisttables_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletoautoscale_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletomanualthroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesupdatetablethroughput_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_accountkeymetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_analyticalstorageconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_apiproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettingsresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoupgradepolicyresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicymigrationstate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capability.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capacity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspaceresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrapartitionkey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandraschema.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratableresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionincludedpath.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyslistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clusterkey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_column.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_compositepath.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_conflictresolutionpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_consistencypolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_containerpartitionkey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_continuousmodebackuppolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_corspolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_createupdateoptions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountconnectionstring.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountkeysmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistconnectionstringsresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistkeysresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistreadonlykeysresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountregeneratekeyparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountslistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaserestoreresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_excludedpath.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicies.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaselistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaseresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaserestoreresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_includedpath.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexingpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_ipaddressorrange.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_keywrapmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_location.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationgetresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metric.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricavailability.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinition.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinitionslistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metriclistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricname.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricvalue.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaselistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaseresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindex.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexkeys.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexoptions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_optionsresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetric.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetriclistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusagesresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetric.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetriclistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetricvalue.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodebackuppolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointproperty.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privatelinkserviceconnectionstateproperty.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_regionforonlineoffline.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_restoreparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_spatialspec.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetpropertiesresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaselistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaseresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedureresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tableresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputpolicyresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekeypolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usagesresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_virtualnetworkrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongoroledefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongouserdefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongoroledefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongouserdefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongoroledefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongouserdefinition_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongoroledefinitions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongouserdefinitions_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitioncreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitiongetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitioncreateupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitiongetresults.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionlistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilege.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilegeresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_role.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/version.go diff --git a/internal/services/cosmos/client/client.go b/internal/services/cosmos/client/client.go index 12f3bb51732f..e18f49def2e1 100644 --- a/internal/services/cosmos/client/client.go +++ b/internal/services/cosmos/client/client.go @@ -4,6 +4,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/managedcassandras" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway" + "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -14,6 +15,7 @@ type Client struct { DatabaseClient *documentdb.DatabaseAccountsClient GremlinClient *documentdb.GremlinResourcesClient MongoDbClient *documentdb.MongoDBResourcesClient + MongoRBACClient *mongorbacs.MongorbacsClient NotebookWorkspaceClient *documentdb.NotebookWorkspacesClient RestorableDatabaseAccountsClient *documentdb.RestorableDatabaseAccountsClient SqlDedicatedGatewayClient *sqldedicatedgateway.SqlDedicatedGatewayClient @@ -41,6 +43,9 @@ func NewClient(o *common.ClientOptions) *Client { mongoDbClient := documentdb.NewMongoDBResourcesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&mongoDbClient.Client, o.ResourceManagerAuthorizer) + mongorbacsClient := mongorbacs.NewMongorbacsClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&mongorbacsClient.Client, o.ResourceManagerAuthorizer) + notebookWorkspaceClient := documentdb.NewNotebookWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(¬ebookWorkspaceClient.Client, o.ResourceManagerAuthorizer) @@ -66,6 +71,7 @@ func NewClient(o *common.ClientOptions) *Client { DatabaseClient: &databaseClient, GremlinClient: &gremlinClient, MongoDbClient: &mongoDbClient, + MongoRBACClient: &mongorbacsClient, NotebookWorkspaceClient: ¬ebookWorkspaceClient, RestorableDatabaseAccountsClient: &restorableDatabaseAccountsClient, SqlDedicatedGatewayClient: &sqlDedicatedGatewayClient, diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go new file mode 100644 index 000000000000..c009b6c9245f --- /dev/null +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -0,0 +1,327 @@ +package cosmos + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type CosmosDbMongoUserDefinitionModel struct { + AccountId string `tfschema:"account_id"` + CustomData string `tfschema:"custom_data"` + DBName string `tfschema:"db_name"` + Password string `tfschema:"password"` + Roles []Role `tfschema:"roles"` + Username string `tfschema:"username"` +} + +type Role struct { + Db string `tfschema:"db"` + Role string `tfschema:"role"` +} + +type CosmosDbMongoUserDefinitionResource struct{} + +var _ sdk.ResourceWithUpdate = CosmosDbMongoUserDefinitionResource{} + +func (r CosmosDbMongoUserDefinitionResource) ResourceType() string { + return "azurerm_cosmosdb_mongo_user_definition" +} + +func (r CosmosDbMongoUserDefinitionResource) ModelObject() interface{} { + return &CosmosDbMongoUserDefinitionModel{} +} + +func (r CosmosDbMongoUserDefinitionResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return mongorbacs.ValidateMongodbUserDefinitionID +} + +func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "account_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: mongorbacs.ValidateDatabaseAccountID, + }, + + "db_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "username": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "password": { + Type: pluginsdk.TypeString, + Required: true, + Sensitive: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "custom_data": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "roles": { + Type: pluginsdk.TypeList, + Optional: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "db": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "role": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, + }, + }, + } +} + +func (r CosmosDbMongoUserDefinitionResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + var model CosmosDbMongoUserDefinitionModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + client := metadata.Client.Cosmos.MongoRBACClient + databaseAccountId, err := mongorbacs.ParseDatabaseAccountID(model.AccountId) + if err != nil { + return err + } + + mongoUserDefinitionId := fmt.Sprintf("%s.%s", model.DBName, model.Username) + id := mongorbacs.NewMongodbUserDefinitionID(databaseAccountId.SubscriptionId, databaseAccountId.ResourceGroupName, databaseAccountId.DatabaseAccountName, mongoUserDefinitionId) + + existing, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) + if err != nil && !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for existing %s: %+v", id, err) + } + + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + properties := &mongorbacs.MongoUserDefinitionCreateUpdateParameters{ + Properties: &mongorbacs.MongoUserDefinitionResource{ + DatabaseName: &model.DBName, + Mechanisms: utils.String("SCRAM-SHA-256"), + Password: &model.Password, + UserName: &model.Username, + }, + } + + if model.CustomData != "" { + properties.Properties.CustomData = &model.CustomData + } + + rolesValue, err := expandRole(model.Roles) + if err != nil { + return err + } + properties.Properties.Roles = rolesValue + + if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id, *properties); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Cosmos.MongoRBACClient + + id, err := mongorbacs.ParseMongodbUserDefinitionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + var model CosmosDbMongoUserDefinitionModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + resp, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + properties := resp.Model + if properties == nil { + return fmt.Errorf("retrieving %s: properties was nil", id) + } + + parameters := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ + Properties: &mongorbacs.MongoUserDefinitionResource{ + DatabaseName: &model.DBName, + Mechanisms: utils.String("SCRAM-SHA-256"), + Password: &model.Password, + UserName: &model.Username, + }, + } + + if model.CustomData != "" { + properties.Properties.CustomData = &model.CustomData + } + + rolesValue, err := expandRole(model.Roles) + if err != nil { + return err + } + properties.Properties.Roles = rolesValue + + if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, *id, parameters); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r CosmosDbMongoUserDefinitionResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Cosmos.MongoRBACClient + + id, err := mongorbacs.ParseMongodbUserDefinitionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(id) + } + + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + model := resp.Model + if model == nil { + return fmt.Errorf("retrieving %s: model was nil", id) + } + + state := CosmosDbMongoUserDefinitionModel{ + AccountId: mongorbacs.NewDatabaseAccountID(id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName).ID(), + } + + if properties := model.Properties; properties != nil { + state.DBName = *properties.DatabaseName + state.Username = *properties.UserName + state.Password = metadata.ResourceData.Get("password").(string) + state.CustomData = metadata.ResourceData.Get("custom_data").(string) + + rolesValue, err := flattenRole(properties.Roles) + if err != nil { + return err + } + state.Roles = rolesValue + } + + return metadata.Encode(&state) + }, + } +} + +func (r CosmosDbMongoUserDefinitionResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Cosmos.MongoRBACClient + + id, err := mongorbacs.ParseMongodbUserDefinitionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", id, err) + } + + return nil + }, + } +} + +func expandRole(input []Role) (*[]mongorbacs.Role, error) { + var result []mongorbacs.Role + + for _, v := range input { + input := v + output := mongorbacs.Role{} + + if input.Db != "" { + output.Db = &input.Db + } + + if input.Role != "" { + output.Role = &input.Role + } + + result = append(result, output) + } + + return &result, nil +} + +func flattenRole(input *[]mongorbacs.Role) ([]Role, error) { + var result []Role + if input == nil { + return result, nil + } + + for _, input := range *input { + output := Role{} + + if input.Db != nil { + output.Db = *input.Db + } + + if input.Role != nil { + output.Role = *input.Role + } + + result = append(result, output) + } + + return result, nil +} diff --git a/internal/services/cosmos/registration.go b/internal/services/cosmos/registration.go index e425f0e7c9bf..9109f55088c3 100644 --- a/internal/services/cosmos/registration.go +++ b/internal/services/cosmos/registration.go @@ -22,6 +22,7 @@ func (r Registration) DataSources() []sdk.DataSource { func (r Registration) Resources() []sdk.Resource { return []sdk.Resource{ + CosmosDbMongoUserDefinitionResource{}, CosmosDbSqlDedicatedGatewayResource{}, } } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md new file mode 100644 index 000000000000..d9ee151f1268 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md @@ -0,0 +1,1892 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb` Documentation + +The `cosmosdb` SDK allows for interaction with the Azure Resource Manager Service `cosmosdb` (API Version `2022-11-15`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb" +``` + + +### Client Initialization + +```go +client := cosmosdb.NewCosmosDBClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesCreateUpdateCassandraKeyspace` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ + // ... +} + + +if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesCreateUpdateCassandraTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +payload := cosmosdb.CassandraTableCreateUpdateParameters{ + // ... +} + + +if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesDeleteCassandraKeyspace` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesDeleteCassandraTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesGetCassandraKeyspace` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesGetCassandraKeyspaceThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesGetCassandraTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +read, err := client.CassandraResourcesGetCassandraTable(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesGetCassandraTableThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesListCassandraKeyspaces` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesListCassandraTables` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +read, err := client.CassandraResourcesListCassandraTables(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesMigrateCassandraKeyspaceToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesMigrateCassandraKeyspaceToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesMigrateCassandraTableToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesMigrateCassandraTableToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesUpdateCassandraKeyspaceThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CassandraResourcesUpdateCassandraTableThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "cassandraKeyspaceValue", "tableValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.CollectionListMetricDefinitions` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue") + +read, err := client.CollectionListMetricDefinitions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue") + +read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionListUsages` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue") + +read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionPartitionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue") + +read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionPartitionListUsages` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue") + +read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionPartitionRegionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "regionValue", "databaseValue", "collectionValue") + +read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.CollectionRegionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "regionValue", "databaseValue", "collectionValue") + +read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountRegionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "regionValue") + +read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsCheckNameExists` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountNameID("databaseAccountNameValue") + +read, err := client.DatabaseAccountsCheckNameExists(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsCreateOrUpdate` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ + // ... +} + + +if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsDelete` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsFailoverPriorityChange` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.FailoverPolicies{ + // ... +} + + +if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsGet` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsGetReadOnlyKeys` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsList` + +```go +ctx := context.TODO() +id := cosmosdb.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.DatabaseAccountsList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListByResourceGroup` + +```go +ctx := context.TODO() +id := cosmosdb.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +read, err := client.DatabaseAccountsListByResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListConnectionStrings` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListKeys` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListMetricDefinitions` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListReadOnlyKeys` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsListUsages` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsOfflineRegion` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.RegionForOnlineOffline{ + // ... +} + + +if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsOnlineRegion` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.RegionForOnlineOffline{ + // ... +} + + +if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsRegenerateKey` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ + // ... +} + + +if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseAccountsUpdate` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +payload := cosmosdb.DatabaseAccountUpdateParameters{ + // ... +} + + +if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseListMetricDefinitions` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue") + +read, err := client.DatabaseListMetricDefinitions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue") + +read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.DatabaseListUsages` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue") + +read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesCreateUpdateGremlinDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ + // ... +} + + +if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesCreateUpdateGremlinGraph` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +payload := cosmosdb.GremlinGraphCreateUpdateParameters{ + // ... +} + + +if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesDeleteGremlinDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesDeleteGremlinGraph` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesGetGremlinDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesGetGremlinDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesGetGremlinGraph` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesGetGremlinGraphThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesListGremlinDatabases` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesListGremlinGraphs` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesMigrateGremlinDatabaseToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesMigrateGremlinDatabaseToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesMigrateGremlinGraphToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesMigrateGremlinGraphToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesUpdateGremlinDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.GremlinResourcesUpdateGremlinGraphThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "gremlinDatabaseValue", "graphValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.LocationsGet` + +```go +ctx := context.TODO() +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.LocationsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.LocationsList` + +```go +ctx := context.TODO() +id := cosmosdb.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.LocationsList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesCreateUpdateMongoDBCollection` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesCreateUpdateMongoDBDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesDeleteMongoDBCollection` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesDeleteMongoDBDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesGetMongoDBCollection` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesGetMongoDBCollectionThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesGetMongoDBDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesGetMongoDBDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesListMongoDBCollections` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesListMongoDBDatabases` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesMigrateMongoDBCollectionToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesMigrateMongoDBCollectionToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesMigrateMongoDBDatabaseToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesUpdateMongoDBCollectionThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue", "collectionValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.MongoDBResourcesUpdateMongoDBDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongodbDatabaseValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.PartitionKeyRangeIdListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "databaseValue", "collectionValue", "partitionKeyRangeIdValue") + +read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.PartitionKeyRangeIdRegionListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "regionValue", "databaseValue", "collectionValue", "partitionKeyRangeIdValue") + +read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.PercentileListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.PercentileSourceTargetListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sourceRegionValue", "targetRegionValue") + +read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.PercentileTargetListMetrics` + +```go +ctx := context.TODO() +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "targetRegionValue") + +read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateClientEncryptionKey` + +```go +ctx := context.TODO() +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "clientEncryptionKeyValue") + +payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateSqlContainer` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +payload := cosmosdb.SqlContainerCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateSqlDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateSqlStoredProcedure` + +```go +ctx := context.TODO() +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "storedProcedureValue") + +payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateSqlTrigger` + +```go +ctx := context.TODO() +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "triggerValue") + +payload := cosmosdb.SqlTriggerCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesCreateUpdateSqlUserDefinedFunction` + +```go +ctx := context.TODO() +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "userDefinedFunctionValue") + +payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesDeleteSqlContainer` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesDeleteSqlDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesDeleteSqlStoredProcedure` + +```go +ctx := context.TODO() +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "storedProcedureValue") + +if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesDeleteSqlTrigger` + +```go +ctx := context.TODO() +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "triggerValue") + +if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesDeleteSqlUserDefinedFunction` + +```go +ctx := context.TODO() +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "userDefinedFunctionValue") + +if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetClientEncryptionKey` + +```go +ctx := context.TODO() +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "clientEncryptionKeyValue") + +read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlContainer` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +read, err := client.SqlResourcesGetSqlContainer(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlContainerThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlDatabase` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +read, err := client.SqlResourcesGetSqlDatabase(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlStoredProcedure` + +```go +ctx := context.TODO() +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "storedProcedureValue") + +read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlTrigger` + +```go +ctx := context.TODO() +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "triggerValue") + +read, err := client.SqlResourcesGetSqlTrigger(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesGetSqlUserDefinedFunction` + +```go +ctx := context.TODO() +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue", "userDefinedFunctionValue") + +read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListClientEncryptionKeys` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListSqlContainers` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +read, err := client.SqlResourcesListSqlContainers(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListSqlDatabases` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.SqlResourcesListSqlDatabases(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListSqlStoredProcedures` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListSqlTriggers` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +read, err := client.SqlResourcesListSqlTriggers(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesListSqlUserDefinedFunctions` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesMigrateSqlContainerToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesMigrateSqlContainerToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesMigrateSqlDatabaseToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesMigrateSqlDatabaseToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesUpdateSqlContainerThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue", "containerValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.SqlResourcesUpdateSqlDatabaseThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "sqlDatabaseValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesCreateUpdateTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +payload := cosmosdb.TableCreateUpdateParameters{ + // ... +} + + +if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesDeleteTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesGetTable` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +read, err := client.TableResourcesGetTable(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesGetTableThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +read, err := client.TableResourcesGetTableThroughput(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesListTables` + +```go +ctx := context.TODO() +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.TableResourcesListTables(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesMigrateTableToAutoscale` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesMigrateTableToManualThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CosmosDBClient.TableResourcesUpdateTableThroughput` + +```go +ctx := context.TODO() +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "tableValue") + +payload := cosmosdb.ThroughputSettingsUpdateParameters{ + // ... +} + + +if err := client.TableResourcesUpdateTableThroughputThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/client.go new file mode 100644 index 000000000000..92f209fcdd4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/client.go @@ -0,0 +1,18 @@ +package cosmosdb + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDBClient struct { + Client autorest.Client + baseUri string +} + +func NewCosmosDBClientWithBaseURI(endpoint string) CosmosDBClient { + return CosmosDBClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/constants.go new file mode 100644 index 000000000000..bf80f60ac63c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/constants.go @@ -0,0 +1,824 @@ +package cosmosdb + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AnalyticalStorageSchemaType string + +const ( + AnalyticalStorageSchemaTypeFullFidelity AnalyticalStorageSchemaType = "FullFidelity" + AnalyticalStorageSchemaTypeWellDefined AnalyticalStorageSchemaType = "WellDefined" +) + +func PossibleValuesForAnalyticalStorageSchemaType() []string { + return []string{ + string(AnalyticalStorageSchemaTypeFullFidelity), + string(AnalyticalStorageSchemaTypeWellDefined), + } +} + +func parseAnalyticalStorageSchemaType(input string) (*AnalyticalStorageSchemaType, error) { + vals := map[string]AnalyticalStorageSchemaType{ + "fullfidelity": AnalyticalStorageSchemaTypeFullFidelity, + "welldefined": AnalyticalStorageSchemaTypeWellDefined, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AnalyticalStorageSchemaType(input) + return &out, nil +} + +type BackupPolicyMigrationStatus string + +const ( + BackupPolicyMigrationStatusCompleted BackupPolicyMigrationStatus = "Completed" + BackupPolicyMigrationStatusFailed BackupPolicyMigrationStatus = "Failed" + BackupPolicyMigrationStatusInProgress BackupPolicyMigrationStatus = "InProgress" + BackupPolicyMigrationStatusInvalid BackupPolicyMigrationStatus = "Invalid" +) + +func PossibleValuesForBackupPolicyMigrationStatus() []string { + return []string{ + string(BackupPolicyMigrationStatusCompleted), + string(BackupPolicyMigrationStatusFailed), + string(BackupPolicyMigrationStatusInProgress), + string(BackupPolicyMigrationStatusInvalid), + } +} + +func parseBackupPolicyMigrationStatus(input string) (*BackupPolicyMigrationStatus, error) { + vals := map[string]BackupPolicyMigrationStatus{ + "completed": BackupPolicyMigrationStatusCompleted, + "failed": BackupPolicyMigrationStatusFailed, + "inprogress": BackupPolicyMigrationStatusInProgress, + "invalid": BackupPolicyMigrationStatusInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupPolicyMigrationStatus(input) + return &out, nil +} + +type BackupPolicyType string + +const ( + BackupPolicyTypeContinuous BackupPolicyType = "Continuous" + BackupPolicyTypePeriodic BackupPolicyType = "Periodic" +) + +func PossibleValuesForBackupPolicyType() []string { + return []string{ + string(BackupPolicyTypeContinuous), + string(BackupPolicyTypePeriodic), + } +} + +func parseBackupPolicyType(input string) (*BackupPolicyType, error) { + vals := map[string]BackupPolicyType{ + "continuous": BackupPolicyTypeContinuous, + "periodic": BackupPolicyTypePeriodic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupPolicyType(input) + return &out, nil +} + +type BackupStorageRedundancy string + +const ( + BackupStorageRedundancyGeo BackupStorageRedundancy = "Geo" + BackupStorageRedundancyLocal BackupStorageRedundancy = "Local" + BackupStorageRedundancyZone BackupStorageRedundancy = "Zone" +) + +func PossibleValuesForBackupStorageRedundancy() []string { + return []string{ + string(BackupStorageRedundancyGeo), + string(BackupStorageRedundancyLocal), + string(BackupStorageRedundancyZone), + } +} + +func parseBackupStorageRedundancy(input string) (*BackupStorageRedundancy, error) { + vals := map[string]BackupStorageRedundancy{ + "geo": BackupStorageRedundancyGeo, + "local": BackupStorageRedundancyLocal, + "zone": BackupStorageRedundancyZone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupStorageRedundancy(input) + return &out, nil +} + +type CompositePathSortOrder string + +const ( + CompositePathSortOrderAscending CompositePathSortOrder = "ascending" + CompositePathSortOrderDescending CompositePathSortOrder = "descending" +) + +func PossibleValuesForCompositePathSortOrder() []string { + return []string{ + string(CompositePathSortOrderAscending), + string(CompositePathSortOrderDescending), + } +} + +func parseCompositePathSortOrder(input string) (*CompositePathSortOrder, error) { + vals := map[string]CompositePathSortOrder{ + "ascending": CompositePathSortOrderAscending, + "descending": CompositePathSortOrderDescending, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CompositePathSortOrder(input) + return &out, nil +} + +type ConflictResolutionMode string + +const ( + ConflictResolutionModeCustom ConflictResolutionMode = "Custom" + ConflictResolutionModeLastWriterWins ConflictResolutionMode = "LastWriterWins" +) + +func PossibleValuesForConflictResolutionMode() []string { + return []string{ + string(ConflictResolutionModeCustom), + string(ConflictResolutionModeLastWriterWins), + } +} + +func parseConflictResolutionMode(input string) (*ConflictResolutionMode, error) { + vals := map[string]ConflictResolutionMode{ + "custom": ConflictResolutionModeCustom, + "lastwriterwins": ConflictResolutionModeLastWriterWins, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConflictResolutionMode(input) + return &out, nil +} + +type ConnectorOffer string + +const ( + ConnectorOfferSmall ConnectorOffer = "Small" +) + +func PossibleValuesForConnectorOffer() []string { + return []string{ + string(ConnectorOfferSmall), + } +} + +func parseConnectorOffer(input string) (*ConnectorOffer, error) { + vals := map[string]ConnectorOffer{ + "small": ConnectorOfferSmall, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConnectorOffer(input) + return &out, nil +} + +type CreateMode string + +const ( + CreateModeDefault CreateMode = "Default" + CreateModeRestore CreateMode = "Restore" +) + +func PossibleValuesForCreateMode() []string { + return []string{ + string(CreateModeDefault), + string(CreateModeRestore), + } +} + +func parseCreateMode(input string) (*CreateMode, error) { + vals := map[string]CreateMode{ + "default": CreateModeDefault, + "restore": CreateModeRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CreateMode(input) + return &out, nil +} + +type DataType string + +const ( + DataTypeLineString DataType = "LineString" + DataTypeMultiPolygon DataType = "MultiPolygon" + DataTypeNumber DataType = "Number" + DataTypePoint DataType = "Point" + DataTypePolygon DataType = "Polygon" + DataTypeString DataType = "String" +) + +func PossibleValuesForDataType() []string { + return []string{ + string(DataTypeLineString), + string(DataTypeMultiPolygon), + string(DataTypeNumber), + string(DataTypePoint), + string(DataTypePolygon), + string(DataTypeString), + } +} + +func parseDataType(input string) (*DataType, error) { + vals := map[string]DataType{ + "linestring": DataTypeLineString, + "multipolygon": DataTypeMultiPolygon, + "number": DataTypeNumber, + "point": DataTypePoint, + "polygon": DataTypePolygon, + "string": DataTypeString, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataType(input) + return &out, nil +} + +type DatabaseAccountKind string + +const ( + DatabaseAccountKindGlobalDocumentDB DatabaseAccountKind = "GlobalDocumentDB" + DatabaseAccountKindMongoDB DatabaseAccountKind = "MongoDB" + DatabaseAccountKindParse DatabaseAccountKind = "Parse" +) + +func PossibleValuesForDatabaseAccountKind() []string { + return []string{ + string(DatabaseAccountKindGlobalDocumentDB), + string(DatabaseAccountKindMongoDB), + string(DatabaseAccountKindParse), + } +} + +func parseDatabaseAccountKind(input string) (*DatabaseAccountKind, error) { + vals := map[string]DatabaseAccountKind{ + "globaldocumentdb": DatabaseAccountKindGlobalDocumentDB, + "mongodb": DatabaseAccountKindMongoDB, + "parse": DatabaseAccountKindParse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseAccountKind(input) + return &out, nil +} + +type DatabaseAccountOfferType string + +const ( + DatabaseAccountOfferTypeStandard DatabaseAccountOfferType = "Standard" +) + +func PossibleValuesForDatabaseAccountOfferType() []string { + return []string{ + string(DatabaseAccountOfferTypeStandard), + } +} + +func parseDatabaseAccountOfferType(input string) (*DatabaseAccountOfferType, error) { + vals := map[string]DatabaseAccountOfferType{ + "standard": DatabaseAccountOfferTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseAccountOfferType(input) + return &out, nil +} + +type DefaultConsistencyLevel string + +const ( + DefaultConsistencyLevelBoundedStaleness DefaultConsistencyLevel = "BoundedStaleness" + DefaultConsistencyLevelConsistentPrefix DefaultConsistencyLevel = "ConsistentPrefix" + DefaultConsistencyLevelEventual DefaultConsistencyLevel = "Eventual" + DefaultConsistencyLevelSession DefaultConsistencyLevel = "Session" + DefaultConsistencyLevelStrong DefaultConsistencyLevel = "Strong" +) + +func PossibleValuesForDefaultConsistencyLevel() []string { + return []string{ + string(DefaultConsistencyLevelBoundedStaleness), + string(DefaultConsistencyLevelConsistentPrefix), + string(DefaultConsistencyLevelEventual), + string(DefaultConsistencyLevelSession), + string(DefaultConsistencyLevelStrong), + } +} + +func parseDefaultConsistencyLevel(input string) (*DefaultConsistencyLevel, error) { + vals := map[string]DefaultConsistencyLevel{ + "boundedstaleness": DefaultConsistencyLevelBoundedStaleness, + "consistentprefix": DefaultConsistencyLevelConsistentPrefix, + "eventual": DefaultConsistencyLevelEventual, + "session": DefaultConsistencyLevelSession, + "strong": DefaultConsistencyLevelStrong, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DefaultConsistencyLevel(input) + return &out, nil +} + +type IndexKind string + +const ( + IndexKindHash IndexKind = "Hash" + IndexKindRange IndexKind = "Range" + IndexKindSpatial IndexKind = "Spatial" +) + +func PossibleValuesForIndexKind() []string { + return []string{ + string(IndexKindHash), + string(IndexKindRange), + string(IndexKindSpatial), + } +} + +func parseIndexKind(input string) (*IndexKind, error) { + vals := map[string]IndexKind{ + "hash": IndexKindHash, + "range": IndexKindRange, + "spatial": IndexKindSpatial, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IndexKind(input) + return &out, nil +} + +type IndexingMode string + +const ( + IndexingModeConsistent IndexingMode = "consistent" + IndexingModeLazy IndexingMode = "lazy" + IndexingModeNone IndexingMode = "none" +) + +func PossibleValuesForIndexingMode() []string { + return []string{ + string(IndexingModeConsistent), + string(IndexingModeLazy), + string(IndexingModeNone), + } +} + +func parseIndexingMode(input string) (*IndexingMode, error) { + vals := map[string]IndexingMode{ + "consistent": IndexingModeConsistent, + "lazy": IndexingModeLazy, + "none": IndexingModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IndexingMode(input) + return &out, nil +} + +type KeyKind string + +const ( + KeyKindPrimary KeyKind = "primary" + KeyKindPrimaryReadonly KeyKind = "primaryReadonly" + KeyKindSecondary KeyKind = "secondary" + KeyKindSecondaryReadonly KeyKind = "secondaryReadonly" +) + +func PossibleValuesForKeyKind() []string { + return []string{ + string(KeyKindPrimary), + string(KeyKindPrimaryReadonly), + string(KeyKindSecondary), + string(KeyKindSecondaryReadonly), + } +} + +func parseKeyKind(input string) (*KeyKind, error) { + vals := map[string]KeyKind{ + "primary": KeyKindPrimary, + "primaryreadonly": KeyKindPrimaryReadonly, + "secondary": KeyKindSecondary, + "secondaryreadonly": KeyKindSecondaryReadonly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyKind(input) + return &out, nil +} + +type MinimalTlsVersion string + +const ( + MinimalTlsVersionTls MinimalTlsVersion = "Tls" + MinimalTlsVersionTlsOneOne MinimalTlsVersion = "Tls11" + MinimalTlsVersionTlsOneTwo MinimalTlsVersion = "Tls12" +) + +func PossibleValuesForMinimalTlsVersion() []string { + return []string{ + string(MinimalTlsVersionTls), + string(MinimalTlsVersionTlsOneOne), + string(MinimalTlsVersionTlsOneTwo), + } +} + +func parseMinimalTlsVersion(input string) (*MinimalTlsVersion, error) { + vals := map[string]MinimalTlsVersion{ + "tls": MinimalTlsVersionTls, + "tls11": MinimalTlsVersionTlsOneOne, + "tls12": MinimalTlsVersionTlsOneTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MinimalTlsVersion(input) + return &out, nil +} + +type NetworkAclBypass string + +const ( + NetworkAclBypassAzureServices NetworkAclBypass = "AzureServices" + NetworkAclBypassNone NetworkAclBypass = "None" +) + +func PossibleValuesForNetworkAclBypass() []string { + return []string{ + string(NetworkAclBypassAzureServices), + string(NetworkAclBypassNone), + } +} + +func parseNetworkAclBypass(input string) (*NetworkAclBypass, error) { + vals := map[string]NetworkAclBypass{ + "azureservices": NetworkAclBypassAzureServices, + "none": NetworkAclBypassNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkAclBypass(input) + return &out, nil +} + +type PartitionKind string + +const ( + PartitionKindHash PartitionKind = "Hash" + PartitionKindMultiHash PartitionKind = "MultiHash" + PartitionKindRange PartitionKind = "Range" +) + +func PossibleValuesForPartitionKind() []string { + return []string{ + string(PartitionKindHash), + string(PartitionKindMultiHash), + string(PartitionKindRange), + } +} + +func parsePartitionKind(input string) (*PartitionKind, error) { + vals := map[string]PartitionKind{ + "hash": PartitionKindHash, + "multihash": PartitionKindMultiHash, + "range": PartitionKindRange, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PartitionKind(input) + return &out, nil +} + +type PrimaryAggregationType string + +const ( + PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" + PrimaryAggregationTypeLast PrimaryAggregationType = "Last" + PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" + PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" + PrimaryAggregationTypeNone PrimaryAggregationType = "None" + PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" +) + +func PossibleValuesForPrimaryAggregationType() []string { + return []string{ + string(PrimaryAggregationTypeAverage), + string(PrimaryAggregationTypeLast), + string(PrimaryAggregationTypeMaximum), + string(PrimaryAggregationTypeMinimum), + string(PrimaryAggregationTypeNone), + string(PrimaryAggregationTypeTotal), + } +} + +func parsePrimaryAggregationType(input string) (*PrimaryAggregationType, error) { + vals := map[string]PrimaryAggregationType{ + "average": PrimaryAggregationTypeAverage, + "last": PrimaryAggregationTypeLast, + "maximum": PrimaryAggregationTypeMaximum, + "minimum": PrimaryAggregationTypeMinimum, + "none": PrimaryAggregationTypeNone, + "total": PrimaryAggregationTypeTotal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrimaryAggregationType(input) + return &out, nil +} + +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +func PossibleValuesForPublicNetworkAccess() []string { + return []string{ + string(PublicNetworkAccessDisabled), + string(PublicNetworkAccessEnabled), + } +} + +func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { + vals := map[string]PublicNetworkAccess{ + "disabled": PublicNetworkAccessDisabled, + "enabled": PublicNetworkAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccess(input) + return &out, nil +} + +type RestoreMode string + +const ( + RestoreModePointInTime RestoreMode = "PointInTime" +) + +func PossibleValuesForRestoreMode() []string { + return []string{ + string(RestoreModePointInTime), + } +} + +func parseRestoreMode(input string) (*RestoreMode, error) { + vals := map[string]RestoreMode{ + "pointintime": RestoreModePointInTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestoreMode(input) + return &out, nil +} + +type ServerVersion string + +const ( + ServerVersionFourPointTwo ServerVersion = "4.2" + ServerVersionFourPointZero ServerVersion = "4.0" + ServerVersionThreePointSix ServerVersion = "3.6" + ServerVersionThreePointTwo ServerVersion = "3.2" +) + +func PossibleValuesForServerVersion() []string { + return []string{ + string(ServerVersionFourPointTwo), + string(ServerVersionFourPointZero), + string(ServerVersionThreePointSix), + string(ServerVersionThreePointTwo), + } +} + +func parseServerVersion(input string) (*ServerVersion, error) { + vals := map[string]ServerVersion{ + "4.2": ServerVersionFourPointTwo, + "4.0": ServerVersionFourPointZero, + "3.6": ServerVersionThreePointSix, + "3.2": ServerVersionThreePointTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerVersion(input) + return &out, nil +} + +type SpatialType string + +const ( + SpatialTypeLineString SpatialType = "LineString" + SpatialTypeMultiPolygon SpatialType = "MultiPolygon" + SpatialTypePoint SpatialType = "Point" + SpatialTypePolygon SpatialType = "Polygon" +) + +func PossibleValuesForSpatialType() []string { + return []string{ + string(SpatialTypeLineString), + string(SpatialTypeMultiPolygon), + string(SpatialTypePoint), + string(SpatialTypePolygon), + } +} + +func parseSpatialType(input string) (*SpatialType, error) { + vals := map[string]SpatialType{ + "linestring": SpatialTypeLineString, + "multipolygon": SpatialTypeMultiPolygon, + "point": SpatialTypePoint, + "polygon": SpatialTypePolygon, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SpatialType(input) + return &out, nil +} + +type TriggerOperation string + +const ( + TriggerOperationAll TriggerOperation = "All" + TriggerOperationCreate TriggerOperation = "Create" + TriggerOperationDelete TriggerOperation = "Delete" + TriggerOperationReplace TriggerOperation = "Replace" + TriggerOperationUpdate TriggerOperation = "Update" +) + +func PossibleValuesForTriggerOperation() []string { + return []string{ + string(TriggerOperationAll), + string(TriggerOperationCreate), + string(TriggerOperationDelete), + string(TriggerOperationReplace), + string(TriggerOperationUpdate), + } +} + +func parseTriggerOperation(input string) (*TriggerOperation, error) { + vals := map[string]TriggerOperation{ + "all": TriggerOperationAll, + "create": TriggerOperationCreate, + "delete": TriggerOperationDelete, + "replace": TriggerOperationReplace, + "update": TriggerOperationUpdate, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerOperation(input) + return &out, nil +} + +type TriggerType string + +const ( + TriggerTypePost TriggerType = "Post" + TriggerTypePre TriggerType = "Pre" +) + +func PossibleValuesForTriggerType() []string { + return []string{ + string(TriggerTypePost), + string(TriggerTypePre), + } +} + +func parseTriggerType(input string) (*TriggerType, error) { + vals := map[string]TriggerType{ + "post": TriggerTypePost, + "pre": TriggerTypePre, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerType(input) + return &out, nil +} + +type UnitType string + +const ( + UnitTypeBytes UnitType = "Bytes" + UnitTypeBytesPerSecond UnitType = "BytesPerSecond" + UnitTypeCount UnitType = "Count" + UnitTypeCountPerSecond UnitType = "CountPerSecond" + UnitTypeMilliseconds UnitType = "Milliseconds" + UnitTypePercent UnitType = "Percent" + UnitTypeSeconds UnitType = "Seconds" +) + +func PossibleValuesForUnitType() []string { + return []string{ + string(UnitTypeBytes), + string(UnitTypeBytesPerSecond), + string(UnitTypeCount), + string(UnitTypeCountPerSecond), + string(UnitTypeMilliseconds), + string(UnitTypePercent), + string(UnitTypeSeconds), + } +} + +func parseUnitType(input string) (*UnitType, error) { + vals := map[string]UnitType{ + "bytes": UnitTypeBytes, + "bytespersecond": UnitTypeBytesPerSecond, + "count": UnitTypeCount, + "countpersecond": UnitTypeCountPerSecond, + "milliseconds": UnitTypeMilliseconds, + "percent": UnitTypePercent, + "seconds": UnitTypeSeconds, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UnitType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go new file mode 100644 index 000000000000..e1899d5bddbb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CassandraKeyspaceId{} + +// CassandraKeyspaceId is a struct representing the Resource ID for a Cassandra Keyspace +type CassandraKeyspaceId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + CassandraKeyspaceName string +} + +// NewCassandraKeyspaceID returns a new CassandraKeyspaceId struct +func NewCassandraKeyspaceID(subscriptionId string, resourceGroupName string, databaseAccountName string, cassandraKeyspaceName string) CassandraKeyspaceId { + return CassandraKeyspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + CassandraKeyspaceName: cassandraKeyspaceName, + } +} + +// ParseCassandraKeyspaceID parses 'input' into a CassandraKeyspaceId +func ParseCassandraKeyspaceID(input string) (*CassandraKeyspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(CassandraKeyspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CassandraKeyspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.CassandraKeyspaceName, ok = parsed.Parsed["cassandraKeyspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'cassandraKeyspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCassandraKeyspaceIDInsensitively parses 'input' case-insensitively into a CassandraKeyspaceId +// note: this method should only be used for API response data and not user input +func ParseCassandraKeyspaceIDInsensitively(input string) (*CassandraKeyspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(CassandraKeyspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CassandraKeyspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.CassandraKeyspaceName, ok = parsed.Parsed["cassandraKeyspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'cassandraKeyspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCassandraKeyspaceID checks that 'input' can be parsed as a Cassandra Keyspace ID +func ValidateCassandraKeyspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCassandraKeyspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cassandra Keyspace ID +func (id CassandraKeyspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/cassandraKeyspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.CassandraKeyspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cassandra Keyspace ID +func (id CassandraKeyspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceValue"), + } +} + +// String returns a human-readable description of this Cassandra Keyspace ID +func (id CassandraKeyspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Cassandra Keyspace Name: %q", id.CassandraKeyspaceName), + } + return fmt.Sprintf("Cassandra Keyspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go new file mode 100644 index 000000000000..64f25cd64fca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CassandraKeyspaceTableId{} + +// CassandraKeyspaceTableId is a struct representing the Resource ID for a Cassandra Keyspace Table +type CassandraKeyspaceTableId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + CassandraKeyspaceName string + TableName string +} + +// NewCassandraKeyspaceTableID returns a new CassandraKeyspaceTableId struct +func NewCassandraKeyspaceTableID(subscriptionId string, resourceGroupName string, databaseAccountName string, cassandraKeyspaceName string, tableName string) CassandraKeyspaceTableId { + return CassandraKeyspaceTableId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + CassandraKeyspaceName: cassandraKeyspaceName, + TableName: tableName, + } +} + +// ParseCassandraKeyspaceTableID parses 'input' into a CassandraKeyspaceTableId +func ParseCassandraKeyspaceTableID(input string) (*CassandraKeyspaceTableId, error) { + parser := resourceids.NewParserFromResourceIdType(CassandraKeyspaceTableId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CassandraKeyspaceTableId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.CassandraKeyspaceName, ok = parsed.Parsed["cassandraKeyspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'cassandraKeyspaceName' was not found in the resource id %q", input) + } + + if id.TableName, ok = parsed.Parsed["tableName"]; !ok { + return nil, fmt.Errorf("the segment 'tableName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCassandraKeyspaceTableIDInsensitively parses 'input' case-insensitively into a CassandraKeyspaceTableId +// note: this method should only be used for API response data and not user input +func ParseCassandraKeyspaceTableIDInsensitively(input string) (*CassandraKeyspaceTableId, error) { + parser := resourceids.NewParserFromResourceIdType(CassandraKeyspaceTableId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CassandraKeyspaceTableId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.CassandraKeyspaceName, ok = parsed.Parsed["cassandraKeyspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'cassandraKeyspaceName' was not found in the resource id %q", input) + } + + if id.TableName, ok = parsed.Parsed["tableName"]; !ok { + return nil, fmt.Errorf("the segment 'tableName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCassandraKeyspaceTableID checks that 'input' can be parsed as a Cassandra Keyspace Table ID +func ValidateCassandraKeyspaceTableID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCassandraKeyspaceTableID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cassandra Keyspace Table ID +func (id CassandraKeyspaceTableId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/cassandraKeyspaces/%s/tables/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.CassandraKeyspaceName, id.TableName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cassandra Keyspace Table ID +func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceValue"), + resourceids.StaticSegment("staticTables", "tables", "tables"), + resourceids.UserSpecifiedSegment("tableName", "tableValue"), + } +} + +// String returns a human-readable description of this Cassandra Keyspace Table ID +func (id CassandraKeyspaceTableId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Cassandra Keyspace Name: %q", id.CassandraKeyspaceName), + fmt.Sprintf("Table Name: %q", id.TableName), + } + return fmt.Sprintf("Cassandra Keyspace Table (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go new file mode 100644 index 000000000000..25bfb8c3b271 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = ClientEncryptionKeyId{} + +// ClientEncryptionKeyId is a struct representing the Resource ID for a Client Encryption Key +type ClientEncryptionKeyId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string + ClientEncryptionKeyName string +} + +// NewClientEncryptionKeyID returns a new ClientEncryptionKeyId struct +func NewClientEncryptionKeyID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string, clientEncryptionKeyName string) ClientEncryptionKeyId { + return ClientEncryptionKeyId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + ClientEncryptionKeyName: clientEncryptionKeyName, + } +} + +// ParseClientEncryptionKeyID parses 'input' into a ClientEncryptionKeyId +func ParseClientEncryptionKeyID(input string) (*ClientEncryptionKeyId, error) { + parser := resourceids.NewParserFromResourceIdType(ClientEncryptionKeyId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ClientEncryptionKeyId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ClientEncryptionKeyName, ok = parsed.Parsed["clientEncryptionKeyName"]; !ok { + return nil, fmt.Errorf("the segment 'clientEncryptionKeyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseClientEncryptionKeyIDInsensitively parses 'input' case-insensitively into a ClientEncryptionKeyId +// note: this method should only be used for API response data and not user input +func ParseClientEncryptionKeyIDInsensitively(input string) (*ClientEncryptionKeyId, error) { + parser := resourceids.NewParserFromResourceIdType(ClientEncryptionKeyId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ClientEncryptionKeyId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ClientEncryptionKeyName, ok = parsed.Parsed["clientEncryptionKeyName"]; !ok { + return nil, fmt.Errorf("the segment 'clientEncryptionKeyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateClientEncryptionKeyID checks that 'input' can be parsed as a Client Encryption Key ID +func ValidateClientEncryptionKeyID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseClientEncryptionKeyID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Client Encryption Key ID +func (id ClientEncryptionKeyId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/clientEncryptionKeys/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName, id.ClientEncryptionKeyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Client Encryption Key ID +func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), + resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyValue"), + } +} + +// String returns a human-readable description of this Client Encryption Key ID +func (id ClientEncryptionKeyId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + fmt.Sprintf("Client Encryption Key Name: %q", id.ClientEncryptionKeyName), + } + return fmt.Sprintf("Client Encryption Key (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go new file mode 100644 index 000000000000..f38d6e45b9a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CollectionId{} + +// CollectionId is a struct representing the Resource ID for a Collection +type CollectionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + DatabaseName string + CollectionName string +} + +// NewCollectionID returns a new CollectionId struct +func NewCollectionID(subscriptionId string, resourceGroupName string, databaseAccountName string, databaseName string, collectionName string) CollectionId { + return CollectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + DatabaseName: databaseName, + CollectionName: collectionName, + } +} + +// ParseCollectionID parses 'input' into a CollectionId +func ParseCollectionID(input string) (*CollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(CollectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCollectionIDInsensitively parses 'input' case-insensitively into a CollectionId +// note: this method should only be used for API response data and not user input +func ParseCollectionIDInsensitively(input string) (*CollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(CollectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCollectionID checks that 'input' can be parsed as a Collection ID +func ValidateCollectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCollectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Collection ID +func (id CollectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/databases/%s/collections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.DatabaseName, id.CollectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Collection ID +func (id CollectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + resourceids.StaticSegment("staticCollections", "collections", "collections"), + resourceids.UserSpecifiedSegment("collectionName", "collectionValue"), + } +} + +// String returns a human-readable description of this Collection ID +func (id CollectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + fmt.Sprintf("Collection Name: %q", id.CollectionName), + } + return fmt.Sprintf("Collection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go new file mode 100644 index 000000000000..5d6e00836918 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -0,0 +1,179 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CollectionPartitionKeyRangeIdId{} + +// CollectionPartitionKeyRangeIdId is a struct representing the Resource ID for a Collection Partition Key Range Id +type CollectionPartitionKeyRangeIdId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + RegionName string + DatabaseName string + CollectionName string + PartitionKeyRangeId string +} + +// NewCollectionPartitionKeyRangeIdID returns a new CollectionPartitionKeyRangeIdId struct +func NewCollectionPartitionKeyRangeIdID(subscriptionId string, resourceGroupName string, databaseAccountName string, regionName string, databaseName string, collectionName string, partitionKeyRangeId string) CollectionPartitionKeyRangeIdId { + return CollectionPartitionKeyRangeIdId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + RegionName: regionName, + DatabaseName: databaseName, + CollectionName: collectionName, + PartitionKeyRangeId: partitionKeyRangeId, + } +} + +// ParseCollectionPartitionKeyRangeIdID parses 'input' into a CollectionPartitionKeyRangeIdId +func ParseCollectionPartitionKeyRangeIdID(input string) (*CollectionPartitionKeyRangeIdId, error) { + parser := resourceids.NewParserFromResourceIdType(CollectionPartitionKeyRangeIdId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CollectionPartitionKeyRangeIdId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + if id.PartitionKeyRangeId, ok = parsed.Parsed["partitionKeyRangeId"]; !ok { + return nil, fmt.Errorf("the segment 'partitionKeyRangeId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCollectionPartitionKeyRangeIdIDInsensitively parses 'input' case-insensitively into a CollectionPartitionKeyRangeIdId +// note: this method should only be used for API response data and not user input +func ParseCollectionPartitionKeyRangeIdIDInsensitively(input string) (*CollectionPartitionKeyRangeIdId, error) { + parser := resourceids.NewParserFromResourceIdType(CollectionPartitionKeyRangeIdId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CollectionPartitionKeyRangeIdId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + if id.PartitionKeyRangeId, ok = parsed.Parsed["partitionKeyRangeId"]; !ok { + return nil, fmt.Errorf("the segment 'partitionKeyRangeId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCollectionPartitionKeyRangeIdID checks that 'input' can be parsed as a Collection Partition Key Range Id ID +func ValidateCollectionPartitionKeyRangeIdID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCollectionPartitionKeyRangeIdID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Collection Partition Key Range Id ID +func (id CollectionPartitionKeyRangeIdId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/region/%s/databases/%s/collections/%s/partitionKeyRangeId/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.RegionName, id.DatabaseName, id.CollectionName, id.PartitionKeyRangeId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Collection Partition Key Range Id ID +func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticRegion", "region", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + resourceids.StaticSegment("staticCollections", "collections", "collections"), + resourceids.UserSpecifiedSegment("collectionName", "collectionValue"), + resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), + resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeIdValue"), + } +} + +// String returns a human-readable description of this Collection Partition Key Range Id ID +func (id CollectionPartitionKeyRangeIdId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Region Name: %q", id.RegionName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + fmt.Sprintf("Collection Name: %q", id.CollectionName), + fmt.Sprintf("Partition Key Range: %q", id.PartitionKeyRangeId), + } + return fmt.Sprintf("Collection Partition Key Range Id (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go new file mode 100644 index 000000000000..9ddb2ad3c8f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = ContainerId{} + +// ContainerId is a struct representing the Resource ID for a Container +type ContainerId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string + ContainerName string +} + +// NewContainerID returns a new ContainerId struct +func NewContainerID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string, containerName string) ContainerId { + return ContainerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + ContainerName: containerName, + } +} + +// ParseContainerID parses 'input' into a ContainerId +func ParseContainerID(input string) (*ContainerId, error) { + parser := resourceids.NewParserFromResourceIdType(ContainerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ContainerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseContainerIDInsensitively parses 'input' case-insensitively into a ContainerId +// note: this method should only be used for API response data and not user input +func ParseContainerIDInsensitively(input string) (*ContainerId, error) { + parser := resourceids.NewParserFromResourceIdType(ContainerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ContainerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateContainerID checks that 'input' can be parsed as a Container ID +func ValidateContainerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseContainerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Container ID +func (id ContainerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/containers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName, id.ContainerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Container ID +func (id ContainerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + resourceids.StaticSegment("staticContainers", "containers", "containers"), + resourceids.UserSpecifiedSegment("containerName", "containerValue"), + } +} + +// String returns a human-readable description of this Container ID +func (id ContainerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + fmt.Sprintf("Container Name: %q", id.ContainerName), + } + return fmt.Sprintf("Container (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go new file mode 100644 index 000000000000..4feb3da5dfa7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = DatabaseId{} + +// DatabaseId is a struct representing the Resource ID for a Database +type DatabaseId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + DatabaseName string +} + +// NewDatabaseID returns a new DatabaseId struct +func NewDatabaseID(subscriptionId string, resourceGroupName string, databaseAccountName string, databaseName string) DatabaseId { + return DatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + DatabaseName: databaseName, + } +} + +// ParseDatabaseID parses 'input' into a DatabaseId +func ParseDatabaseID(input string) (*DatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseIDInsensitively parses 'input' case-insensitively into a DatabaseId +// note: this method should only be used for API response data and not user input +func ParseDatabaseIDInsensitively(input string) (*DatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseID checks that 'input' can be parsed as a Database ID +func ValidateDatabaseID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database ID +func (id DatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/databases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.DatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database ID +func (id DatabaseId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + } +} + +// String returns a human-readable description of this Database ID +func (id DatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + } + return fmt.Sprintf("Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go new file mode 100644 index 000000000000..8f01840058c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go @@ -0,0 +1,127 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = DatabaseAccountId{} + +// DatabaseAccountId is a struct representing the Resource ID for a Database Account +type DatabaseAccountId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string +} + +// NewDatabaseAccountID returns a new DatabaseAccountId struct +func NewDatabaseAccountID(subscriptionId string, resourceGroupName string, databaseAccountName string) DatabaseAccountId { + return DatabaseAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + } +} + +// ParseDatabaseAccountID parses 'input' into a DatabaseAccountId +func ParseDatabaseAccountID(input string) (*DatabaseAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseAccountIDInsensitively parses 'input' case-insensitively into a DatabaseAccountId +// note: this method should only be used for API response data and not user input +func ParseDatabaseAccountIDInsensitively(input string) (*DatabaseAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseAccountID checks that 'input' can be parsed as a Database Account ID +func ValidateDatabaseAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Account ID +func (id DatabaseAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Account ID +func (id DatabaseAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + } +} + +// String returns a human-readable description of this Database Account ID +func (id DatabaseAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + } + return fmt.Sprintf("Database Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccountname.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccountname.go new file mode 100644 index 000000000000..3b7d180e9894 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccountname.go @@ -0,0 +1,101 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = DatabaseAccountNameId{} + +// DatabaseAccountNameId is a struct representing the Resource ID for a Database Account Name +type DatabaseAccountNameId struct { + DatabaseAccountNameName string +} + +// NewDatabaseAccountNameID returns a new DatabaseAccountNameId struct +func NewDatabaseAccountNameID(databaseAccountNameName string) DatabaseAccountNameId { + return DatabaseAccountNameId{ + DatabaseAccountNameName: databaseAccountNameName, + } +} + +// ParseDatabaseAccountNameID parses 'input' into a DatabaseAccountNameId +func ParseDatabaseAccountNameID(input string) (*DatabaseAccountNameId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountNameId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountNameId{} + + if id.DatabaseAccountNameName, ok = parsed.Parsed["databaseAccountNameName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountNameName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseAccountNameIDInsensitively parses 'input' case-insensitively into a DatabaseAccountNameId +// note: this method should only be used for API response data and not user input +func ParseDatabaseAccountNameIDInsensitively(input string) (*DatabaseAccountNameId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountNameId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountNameId{} + + if id.DatabaseAccountNameName, ok = parsed.Parsed["databaseAccountNameName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountNameName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseAccountNameID checks that 'input' can be parsed as a Database Account Name ID +func ValidateDatabaseAccountNameID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseAccountNameID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Account Name ID +func (id DatabaseAccountNameId) ID() string { + fmtString := "/providers/Microsoft.DocumentDB/databaseAccountNames/%s" + return fmt.Sprintf(fmtString, id.DatabaseAccountNameName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Account Name ID +func (id DatabaseAccountNameId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccountNames", "databaseAccountNames", "databaseAccountNames"), + resourceids.UserSpecifiedSegment("databaseAccountNameName", "databaseAccountNameValue"), + } +} + +// String returns a human-readable description of this Database Account Name ID +func (id DatabaseAccountNameId) String() string { + components := []string{ + fmt.Sprintf("Database Account Name Name: %q", id.DatabaseAccountNameName), + } + return fmt.Sprintf("Database Account Name (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go new file mode 100644 index 000000000000..2782c794c3f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go @@ -0,0 +1,166 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = DatabaseCollectionId{} + +// DatabaseCollectionId is a struct representing the Resource ID for a Database Collection +type DatabaseCollectionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + RegionName string + DatabaseName string + CollectionName string +} + +// NewDatabaseCollectionID returns a new DatabaseCollectionId struct +func NewDatabaseCollectionID(subscriptionId string, resourceGroupName string, databaseAccountName string, regionName string, databaseName string, collectionName string) DatabaseCollectionId { + return DatabaseCollectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + RegionName: regionName, + DatabaseName: databaseName, + CollectionName: collectionName, + } +} + +// ParseDatabaseCollectionID parses 'input' into a DatabaseCollectionId +func ParseDatabaseCollectionID(input string) (*DatabaseCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseCollectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseCollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseCollectionIDInsensitively parses 'input' case-insensitively into a DatabaseCollectionId +// note: this method should only be used for API response data and not user input +func ParseDatabaseCollectionIDInsensitively(input string) (*DatabaseCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseCollectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseCollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseCollectionID checks that 'input' can be parsed as a Database Collection ID +func ValidateDatabaseCollectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseCollectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Collection ID +func (id DatabaseCollectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/region/%s/databases/%s/collections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.RegionName, id.DatabaseName, id.CollectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Collection ID +func (id DatabaseCollectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticRegion", "region", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + resourceids.StaticSegment("staticCollections", "collections", "collections"), + resourceids.UserSpecifiedSegment("collectionName", "collectionValue"), + } +} + +// String returns a human-readable description of this Database Collection ID +func (id DatabaseCollectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Region Name: %q", id.RegionName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + fmt.Sprintf("Collection Name: %q", id.CollectionName), + } + return fmt.Sprintf("Database Collection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go new file mode 100644 index 000000000000..3821195efbe3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = GraphId{} + +// GraphId is a struct representing the Resource ID for a Graph +type GraphId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + GremlinDatabaseName string + GraphName string +} + +// NewGraphID returns a new GraphId struct +func NewGraphID(subscriptionId string, resourceGroupName string, databaseAccountName string, gremlinDatabaseName string, graphName string) GraphId { + return GraphId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + GremlinDatabaseName: gremlinDatabaseName, + GraphName: graphName, + } +} + +// ParseGraphID parses 'input' into a GraphId +func ParseGraphID(input string) (*GraphId, error) { + parser := resourceids.NewParserFromResourceIdType(GraphId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := GraphId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.GremlinDatabaseName, ok = parsed.Parsed["gremlinDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'gremlinDatabaseName' was not found in the resource id %q", input) + } + + if id.GraphName, ok = parsed.Parsed["graphName"]; !ok { + return nil, fmt.Errorf("the segment 'graphName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseGraphIDInsensitively parses 'input' case-insensitively into a GraphId +// note: this method should only be used for API response data and not user input +func ParseGraphIDInsensitively(input string) (*GraphId, error) { + parser := resourceids.NewParserFromResourceIdType(GraphId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := GraphId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.GremlinDatabaseName, ok = parsed.Parsed["gremlinDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'gremlinDatabaseName' was not found in the resource id %q", input) + } + + if id.GraphName, ok = parsed.Parsed["graphName"]; !ok { + return nil, fmt.Errorf("the segment 'graphName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateGraphID checks that 'input' can be parsed as a Graph ID +func ValidateGraphID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseGraphID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Graph ID +func (id GraphId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/gremlinDatabases/%s/graphs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.GremlinDatabaseName, id.GraphName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Graph ID +func (id GraphId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseValue"), + resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), + resourceids.UserSpecifiedSegment("graphName", "graphValue"), + } +} + +// String returns a human-readable description of this Graph ID +func (id GraphId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Gremlin Database Name: %q", id.GremlinDatabaseName), + fmt.Sprintf("Graph Name: %q", id.GraphName), + } + return fmt.Sprintf("Graph (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go new file mode 100644 index 000000000000..29ba2b128c8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = GremlinDatabaseId{} + +// GremlinDatabaseId is a struct representing the Resource ID for a Gremlin Database +type GremlinDatabaseId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + GremlinDatabaseName string +} + +// NewGremlinDatabaseID returns a new GremlinDatabaseId struct +func NewGremlinDatabaseID(subscriptionId string, resourceGroupName string, databaseAccountName string, gremlinDatabaseName string) GremlinDatabaseId { + return GremlinDatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + GremlinDatabaseName: gremlinDatabaseName, + } +} + +// ParseGremlinDatabaseID parses 'input' into a GremlinDatabaseId +func ParseGremlinDatabaseID(input string) (*GremlinDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(GremlinDatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := GremlinDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.GremlinDatabaseName, ok = parsed.Parsed["gremlinDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'gremlinDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseGremlinDatabaseIDInsensitively parses 'input' case-insensitively into a GremlinDatabaseId +// note: this method should only be used for API response data and not user input +func ParseGremlinDatabaseIDInsensitively(input string) (*GremlinDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(GremlinDatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := GremlinDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.GremlinDatabaseName, ok = parsed.Parsed["gremlinDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'gremlinDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateGremlinDatabaseID checks that 'input' can be parsed as a Gremlin Database ID +func ValidateGremlinDatabaseID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseGremlinDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Gremlin Database ID +func (id GremlinDatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/gremlinDatabases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.GremlinDatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Gremlin Database ID +func (id GremlinDatabaseId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseValue"), + } +} + +// String returns a human-readable description of this Gremlin Database ID +func (id GremlinDatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Gremlin Database Name: %q", id.GremlinDatabaseName), + } + return fmt.Sprintf("Gremlin Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go new file mode 100644 index 000000000000..2bfb9603d07d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go @@ -0,0 +1,114 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := LocationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.LocationName, ok = parsed.Parsed["locationName"]; !ok { + return nil, fmt.Errorf("the segment 'locationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := LocationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.LocationName, ok = parsed.Parsed["locationName"]; !ok { + return nil, fmt.Errorf("the segment 'locationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.DocumentDB/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationValue"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go new file mode 100644 index 000000000000..793d8df21a70 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = MongodbDatabaseId{} + +// MongodbDatabaseId is a struct representing the Resource ID for a Mongodb Database +type MongodbDatabaseId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + MongodbDatabaseName string +} + +// NewMongodbDatabaseID returns a new MongodbDatabaseId struct +func NewMongodbDatabaseID(subscriptionId string, resourceGroupName string, databaseAccountName string, mongodbDatabaseName string) MongodbDatabaseId { + return MongodbDatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + MongodbDatabaseName: mongodbDatabaseName, + } +} + +// ParseMongodbDatabaseID parses 'input' into a MongodbDatabaseId +func ParseMongodbDatabaseID(input string) (*MongodbDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbDatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongodbDatabaseName, ok = parsed.Parsed["mongodbDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'mongodbDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseMongodbDatabaseIDInsensitively parses 'input' case-insensitively into a MongodbDatabaseId +// note: this method should only be used for API response data and not user input +func ParseMongodbDatabaseIDInsensitively(input string) (*MongodbDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbDatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongodbDatabaseName, ok = parsed.Parsed["mongodbDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'mongodbDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateMongodbDatabaseID checks that 'input' can be parsed as a Mongodb Database ID +func ValidateMongodbDatabaseID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMongodbDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mongodb Database ID +func (id MongodbDatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/mongodbDatabases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.MongodbDatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mongodb Database ID +func (id MongodbDatabaseId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseValue"), + } +} + +// String returns a human-readable description of this Mongodb Database ID +func (id MongodbDatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Mongodb Database Name: %q", id.MongodbDatabaseName), + } + return fmt.Sprintf("Mongodb Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go new file mode 100644 index 000000000000..916fc8a49772 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = MongodbDatabaseCollectionId{} + +// MongodbDatabaseCollectionId is a struct representing the Resource ID for a Mongodb Database Collection +type MongodbDatabaseCollectionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + MongodbDatabaseName string + CollectionName string +} + +// NewMongodbDatabaseCollectionID returns a new MongodbDatabaseCollectionId struct +func NewMongodbDatabaseCollectionID(subscriptionId string, resourceGroupName string, databaseAccountName string, mongodbDatabaseName string, collectionName string) MongodbDatabaseCollectionId { + return MongodbDatabaseCollectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + MongodbDatabaseName: mongodbDatabaseName, + CollectionName: collectionName, + } +} + +// ParseMongodbDatabaseCollectionID parses 'input' into a MongodbDatabaseCollectionId +func ParseMongodbDatabaseCollectionID(input string) (*MongodbDatabaseCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbDatabaseCollectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbDatabaseCollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongodbDatabaseName, ok = parsed.Parsed["mongodbDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'mongodbDatabaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseMongodbDatabaseCollectionIDInsensitively parses 'input' case-insensitively into a MongodbDatabaseCollectionId +// note: this method should only be used for API response data and not user input +func ParseMongodbDatabaseCollectionIDInsensitively(input string) (*MongodbDatabaseCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbDatabaseCollectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbDatabaseCollectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongodbDatabaseName, ok = parsed.Parsed["mongodbDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'mongodbDatabaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateMongodbDatabaseCollectionID checks that 'input' can be parsed as a Mongodb Database Collection ID +func ValidateMongodbDatabaseCollectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMongodbDatabaseCollectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mongodb Database Collection ID +func (id MongodbDatabaseCollectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/mongodbDatabases/%s/collections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.MongodbDatabaseName, id.CollectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mongodb Database Collection ID +func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseValue"), + resourceids.StaticSegment("staticCollections", "collections", "collections"), + resourceids.UserSpecifiedSegment("collectionName", "collectionValue"), + } +} + +// String returns a human-readable description of this Mongodb Database Collection ID +func (id MongodbDatabaseCollectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Mongodb Database Name: %q", id.MongodbDatabaseName), + fmt.Sprintf("Collection Name: %q", id.CollectionName), + } + return fmt.Sprintf("Mongodb Database Collection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go new file mode 100644 index 000000000000..9b372015efe0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go @@ -0,0 +1,166 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = PartitionKeyRangeIdId{} + +// PartitionKeyRangeIdId is a struct representing the Resource ID for a Partition Key Range Id +type PartitionKeyRangeIdId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + DatabaseName string + CollectionName string + PartitionKeyRangeId string +} + +// NewPartitionKeyRangeIdID returns a new PartitionKeyRangeIdId struct +func NewPartitionKeyRangeIdID(subscriptionId string, resourceGroupName string, databaseAccountName string, databaseName string, collectionName string, partitionKeyRangeId string) PartitionKeyRangeIdId { + return PartitionKeyRangeIdId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + DatabaseName: databaseName, + CollectionName: collectionName, + PartitionKeyRangeId: partitionKeyRangeId, + } +} + +// ParsePartitionKeyRangeIdID parses 'input' into a PartitionKeyRangeIdId +func ParsePartitionKeyRangeIdID(input string) (*PartitionKeyRangeIdId, error) { + parser := resourceids.NewParserFromResourceIdType(PartitionKeyRangeIdId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PartitionKeyRangeIdId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + if id.PartitionKeyRangeId, ok = parsed.Parsed["partitionKeyRangeId"]; !ok { + return nil, fmt.Errorf("the segment 'partitionKeyRangeId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParsePartitionKeyRangeIdIDInsensitively parses 'input' case-insensitively into a PartitionKeyRangeIdId +// note: this method should only be used for API response data and not user input +func ParsePartitionKeyRangeIdIDInsensitively(input string) (*PartitionKeyRangeIdId, error) { + parser := resourceids.NewParserFromResourceIdType(PartitionKeyRangeIdId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PartitionKeyRangeIdId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + if id.CollectionName, ok = parsed.Parsed["collectionName"]; !ok { + return nil, fmt.Errorf("the segment 'collectionName' was not found in the resource id %q", input) + } + + if id.PartitionKeyRangeId, ok = parsed.Parsed["partitionKeyRangeId"]; !ok { + return nil, fmt.Errorf("the segment 'partitionKeyRangeId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidatePartitionKeyRangeIdID checks that 'input' can be parsed as a Partition Key Range Id ID +func ValidatePartitionKeyRangeIdID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParsePartitionKeyRangeIdID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Partition Key Range Id ID +func (id PartitionKeyRangeIdId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/databases/%s/collections/%s/partitionKeyRangeId/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.DatabaseName, id.CollectionName, id.PartitionKeyRangeId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Partition Key Range Id ID +func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + resourceids.StaticSegment("staticCollections", "collections", "collections"), + resourceids.UserSpecifiedSegment("collectionName", "collectionValue"), + resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), + resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeIdValue"), + } +} + +// String returns a human-readable description of this Partition Key Range Id ID +func (id PartitionKeyRangeIdId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + fmt.Sprintf("Collection Name: %q", id.CollectionName), + fmt.Sprintf("Partition Key Range: %q", id.PartitionKeyRangeId), + } + return fmt.Sprintf("Partition Key Range Id (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go new file mode 100644 index 000000000000..6c8be11928b3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegionId{} + +// RegionId is a struct representing the Resource ID for a Region +type RegionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + RegionName string +} + +// NewRegionID returns a new RegionId struct +func NewRegionID(subscriptionId string, resourceGroupName string, databaseAccountName string, regionName string) RegionId { + return RegionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + RegionName: regionName, + } +} + +// ParseRegionID parses 'input' into a RegionId +func ParseRegionID(input string) (*RegionId, error) { + parser := resourceids.NewParserFromResourceIdType(RegionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseRegionIDInsensitively parses 'input' case-insensitively into a RegionId +// note: this method should only be used for API response data and not user input +func ParseRegionIDInsensitively(input string) (*RegionId, error) { + parser := resourceids.NewParserFromResourceIdType(RegionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.RegionName, ok = parsed.Parsed["regionName"]; !ok { + return nil, fmt.Errorf("the segment 'regionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateRegionID checks that 'input' can be parsed as a Region ID +func ValidateRegionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseRegionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Region ID +func (id RegionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/region/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.RegionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Region ID +func (id RegionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticRegion", "region", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionValue"), + } +} + +// String returns a human-readable description of this Region ID +func (id RegionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Region Name: %q", id.RegionName), + } + return fmt.Sprintf("Region (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go new file mode 100644 index 000000000000..d2779075eb69 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go @@ -0,0 +1,153 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = SourceRegionTargetRegionId{} + +// SourceRegionTargetRegionId is a struct representing the Resource ID for a Source Region Target Region +type SourceRegionTargetRegionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SourceRegionName string + TargetRegionName string +} + +// NewSourceRegionTargetRegionID returns a new SourceRegionTargetRegionId struct +func NewSourceRegionTargetRegionID(subscriptionId string, resourceGroupName string, databaseAccountName string, sourceRegionName string, targetRegionName string) SourceRegionTargetRegionId { + return SourceRegionTargetRegionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SourceRegionName: sourceRegionName, + TargetRegionName: targetRegionName, + } +} + +// ParseSourceRegionTargetRegionID parses 'input' into a SourceRegionTargetRegionId +func ParseSourceRegionTargetRegionID(input string) (*SourceRegionTargetRegionId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceRegionTargetRegionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceRegionTargetRegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SourceRegionName, ok = parsed.Parsed["sourceRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'sourceRegionName' was not found in the resource id %q", input) + } + + if id.TargetRegionName, ok = parsed.Parsed["targetRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'targetRegionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSourceRegionTargetRegionIDInsensitively parses 'input' case-insensitively into a SourceRegionTargetRegionId +// note: this method should only be used for API response data and not user input +func ParseSourceRegionTargetRegionIDInsensitively(input string) (*SourceRegionTargetRegionId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceRegionTargetRegionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceRegionTargetRegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SourceRegionName, ok = parsed.Parsed["sourceRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'sourceRegionName' was not found in the resource id %q", input) + } + + if id.TargetRegionName, ok = parsed.Parsed["targetRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'targetRegionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSourceRegionTargetRegionID checks that 'input' can be parsed as a Source Region Target Region ID +func ValidateSourceRegionTargetRegionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSourceRegionTargetRegionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Source Region Target Region ID +func (id SourceRegionTargetRegionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sourceRegion/%s/targetRegion/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SourceRegionName, id.TargetRegionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Source Region Target Region ID +func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionValue"), + resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionValue"), + } +} + +// String returns a human-readable description of this Source Region Target Region ID +func (id SourceRegionTargetRegionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Source Region Name: %q", id.SourceRegionName), + fmt.Sprintf("Target Region Name: %q", id.TargetRegionName), + } + return fmt.Sprintf("Source Region Target Region (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go new file mode 100644 index 000000000000..42c1211caf2f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = SqlDatabaseId{} + +// SqlDatabaseId is a struct representing the Resource ID for a Sql Database +type SqlDatabaseId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string +} + +// NewSqlDatabaseID returns a new SqlDatabaseId struct +func NewSqlDatabaseID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string) SqlDatabaseId { + return SqlDatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + } +} + +// ParseSqlDatabaseID parses 'input' into a SqlDatabaseId +func ParseSqlDatabaseID(input string) (*SqlDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(SqlDatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SqlDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSqlDatabaseIDInsensitively parses 'input' case-insensitively into a SqlDatabaseId +// note: this method should only be used for API response data and not user input +func ParseSqlDatabaseIDInsensitively(input string) (*SqlDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(SqlDatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SqlDatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSqlDatabaseID checks that 'input' can be parsed as a Sql Database ID +func ValidateSqlDatabaseID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSqlDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Sql Database ID +func (id SqlDatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Sql Database ID +func (id SqlDatabaseId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + } +} + +// String returns a human-readable description of this Sql Database ID +func (id SqlDatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + } + return fmt.Sprintf("Sql Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go new file mode 100644 index 000000000000..c3c83d363a7d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go @@ -0,0 +1,166 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = StoredProcedureId{} + +// StoredProcedureId is a struct representing the Resource ID for a Stored Procedure +type StoredProcedureId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string + ContainerName string + StoredProcedureName string +} + +// NewStoredProcedureID returns a new StoredProcedureId struct +func NewStoredProcedureID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string, containerName string, storedProcedureName string) StoredProcedureId { + return StoredProcedureId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + ContainerName: containerName, + StoredProcedureName: storedProcedureName, + } +} + +// ParseStoredProcedureID parses 'input' into a StoredProcedureId +func ParseStoredProcedureID(input string) (*StoredProcedureId, error) { + parser := resourceids.NewParserFromResourceIdType(StoredProcedureId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := StoredProcedureId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.StoredProcedureName, ok = parsed.Parsed["storedProcedureName"]; !ok { + return nil, fmt.Errorf("the segment 'storedProcedureName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseStoredProcedureIDInsensitively parses 'input' case-insensitively into a StoredProcedureId +// note: this method should only be used for API response data and not user input +func ParseStoredProcedureIDInsensitively(input string) (*StoredProcedureId, error) { + parser := resourceids.NewParserFromResourceIdType(StoredProcedureId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := StoredProcedureId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.StoredProcedureName, ok = parsed.Parsed["storedProcedureName"]; !ok { + return nil, fmt.Errorf("the segment 'storedProcedureName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateStoredProcedureID checks that 'input' can be parsed as a Stored Procedure ID +func ValidateStoredProcedureID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseStoredProcedureID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Stored Procedure ID +func (id StoredProcedureId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/containers/%s/storedProcedures/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName, id.ContainerName, id.StoredProcedureName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Stored Procedure ID +func (id StoredProcedureId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + resourceids.StaticSegment("staticContainers", "containers", "containers"), + resourceids.UserSpecifiedSegment("containerName", "containerValue"), + resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), + resourceids.UserSpecifiedSegment("storedProcedureName", "storedProcedureValue"), + } +} + +// String returns a human-readable description of this Stored Procedure ID +func (id StoredProcedureId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + fmt.Sprintf("Container Name: %q", id.ContainerName), + fmt.Sprintf("Stored Procedure Name: %q", id.StoredProcedureName), + } + return fmt.Sprintf("Stored Procedure (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go new file mode 100644 index 000000000000..ac6e33bee0b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = TableId{} + +// TableId is a struct representing the Resource ID for a Table +type TableId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + TableName string +} + +// NewTableID returns a new TableId struct +func NewTableID(subscriptionId string, resourceGroupName string, databaseAccountName string, tableName string) TableId { + return TableId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + TableName: tableName, + } +} + +// ParseTableID parses 'input' into a TableId +func ParseTableID(input string) (*TableId, error) { + parser := resourceids.NewParserFromResourceIdType(TableId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TableId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.TableName, ok = parsed.Parsed["tableName"]; !ok { + return nil, fmt.Errorf("the segment 'tableName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseTableIDInsensitively parses 'input' case-insensitively into a TableId +// note: this method should only be used for API response data and not user input +func ParseTableIDInsensitively(input string) (*TableId, error) { + parser := resourceids.NewParserFromResourceIdType(TableId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TableId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.TableName, ok = parsed.Parsed["tableName"]; !ok { + return nil, fmt.Errorf("the segment 'tableName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateTableID checks that 'input' can be parsed as a Table ID +func ValidateTableID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseTableID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Table ID +func (id TableId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/tables/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.TableName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Table ID +func (id TableId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticTables", "tables", "tables"), + resourceids.UserSpecifiedSegment("tableName", "tableValue"), + } +} + +// String returns a human-readable description of this Table ID +func (id TableId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Table Name: %q", id.TableName), + } + return fmt.Sprintf("Table (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go new file mode 100644 index 000000000000..06f03a3e1a0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go @@ -0,0 +1,140 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = TargetRegionId{} + +// TargetRegionId is a struct representing the Resource ID for a Target Region +type TargetRegionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + TargetRegionName string +} + +// NewTargetRegionID returns a new TargetRegionId struct +func NewTargetRegionID(subscriptionId string, resourceGroupName string, databaseAccountName string, targetRegionName string) TargetRegionId { + return TargetRegionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + TargetRegionName: targetRegionName, + } +} + +// ParseTargetRegionID parses 'input' into a TargetRegionId +func ParseTargetRegionID(input string) (*TargetRegionId, error) { + parser := resourceids.NewParserFromResourceIdType(TargetRegionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TargetRegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.TargetRegionName, ok = parsed.Parsed["targetRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'targetRegionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseTargetRegionIDInsensitively parses 'input' case-insensitively into a TargetRegionId +// note: this method should only be used for API response data and not user input +func ParseTargetRegionIDInsensitively(input string) (*TargetRegionId, error) { + parser := resourceids.NewParserFromResourceIdType(TargetRegionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TargetRegionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.TargetRegionName, ok = parsed.Parsed["targetRegionName"]; !ok { + return nil, fmt.Errorf("the segment 'targetRegionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateTargetRegionID checks that 'input' can be parsed as a Target Region ID +func ValidateTargetRegionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseTargetRegionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Target Region ID +func (id TargetRegionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/targetRegion/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.TargetRegionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Target Region ID +func (id TargetRegionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionValue"), + } +} + +// String returns a human-readable description of this Target Region ID +func (id TargetRegionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Target Region Name: %q", id.TargetRegionName), + } + return fmt.Sprintf("Target Region (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go new file mode 100644 index 000000000000..e3f9cd87682c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go @@ -0,0 +1,166 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = TriggerId{} + +// TriggerId is a struct representing the Resource ID for a Trigger +type TriggerId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string + ContainerName string + TriggerName string +} + +// NewTriggerID returns a new TriggerId struct +func NewTriggerID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string, containerName string, triggerName string) TriggerId { + return TriggerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + ContainerName: containerName, + TriggerName: triggerName, + } +} + +// ParseTriggerID parses 'input' into a TriggerId +func ParseTriggerID(input string) (*TriggerId, error) { + parser := resourceids.NewParserFromResourceIdType(TriggerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TriggerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.TriggerName, ok = parsed.Parsed["triggerName"]; !ok { + return nil, fmt.Errorf("the segment 'triggerName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseTriggerIDInsensitively parses 'input' case-insensitively into a TriggerId +// note: this method should only be used for API response data and not user input +func ParseTriggerIDInsensitively(input string) (*TriggerId, error) { + parser := resourceids.NewParserFromResourceIdType(TriggerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TriggerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.TriggerName, ok = parsed.Parsed["triggerName"]; !ok { + return nil, fmt.Errorf("the segment 'triggerName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateTriggerID checks that 'input' can be parsed as a Trigger ID +func ValidateTriggerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseTriggerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Trigger ID +func (id TriggerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/containers/%s/triggers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName, id.ContainerName, id.TriggerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Trigger ID +func (id TriggerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + resourceids.StaticSegment("staticContainers", "containers", "containers"), + resourceids.UserSpecifiedSegment("containerName", "containerValue"), + resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), + resourceids.UserSpecifiedSegment("triggerName", "triggerValue"), + } +} + +// String returns a human-readable description of this Trigger ID +func (id TriggerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + fmt.Sprintf("Container Name: %q", id.ContainerName), + fmt.Sprintf("Trigger Name: %q", id.TriggerName), + } + return fmt.Sprintf("Trigger (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go new file mode 100644 index 000000000000..99111ebc82ae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go @@ -0,0 +1,166 @@ +package cosmosdb + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = UserDefinedFunctionId{} + +// UserDefinedFunctionId is a struct representing the Resource ID for a User Defined Function +type UserDefinedFunctionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + SqlDatabaseName string + ContainerName string + UserDefinedFunctionName string +} + +// NewUserDefinedFunctionID returns a new UserDefinedFunctionId struct +func NewUserDefinedFunctionID(subscriptionId string, resourceGroupName string, databaseAccountName string, sqlDatabaseName string, containerName string, userDefinedFunctionName string) UserDefinedFunctionId { + return UserDefinedFunctionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + SqlDatabaseName: sqlDatabaseName, + ContainerName: containerName, + UserDefinedFunctionName: userDefinedFunctionName, + } +} + +// ParseUserDefinedFunctionID parses 'input' into a UserDefinedFunctionId +func ParseUserDefinedFunctionID(input string) (*UserDefinedFunctionId, error) { + parser := resourceids.NewParserFromResourceIdType(UserDefinedFunctionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := UserDefinedFunctionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.UserDefinedFunctionName, ok = parsed.Parsed["userDefinedFunctionName"]; !ok { + return nil, fmt.Errorf("the segment 'userDefinedFunctionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseUserDefinedFunctionIDInsensitively parses 'input' case-insensitively into a UserDefinedFunctionId +// note: this method should only be used for API response data and not user input +func ParseUserDefinedFunctionIDInsensitively(input string) (*UserDefinedFunctionId, error) { + parser := resourceids.NewParserFromResourceIdType(UserDefinedFunctionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := UserDefinedFunctionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.SqlDatabaseName, ok = parsed.Parsed["sqlDatabaseName"]; !ok { + return nil, fmt.Errorf("the segment 'sqlDatabaseName' was not found in the resource id %q", input) + } + + if id.ContainerName, ok = parsed.Parsed["containerName"]; !ok { + return nil, fmt.Errorf("the segment 'containerName' was not found in the resource id %q", input) + } + + if id.UserDefinedFunctionName, ok = parsed.Parsed["userDefinedFunctionName"]; !ok { + return nil, fmt.Errorf("the segment 'userDefinedFunctionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateUserDefinedFunctionID checks that 'input' can be parsed as a User Defined Function ID +func ValidateUserDefinedFunctionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseUserDefinedFunctionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted User Defined Function ID +func (id UserDefinedFunctionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/sqlDatabases/%s/containers/%s/userDefinedFunctions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.SqlDatabaseName, id.ContainerName, id.UserDefinedFunctionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this User Defined Function ID +func (id UserDefinedFunctionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseValue"), + resourceids.StaticSegment("staticContainers", "containers", "containers"), + resourceids.UserSpecifiedSegment("containerName", "containerValue"), + resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), + resourceids.UserSpecifiedSegment("userDefinedFunctionName", "userDefinedFunctionValue"), + } +} + +// String returns a human-readable description of this User Defined Function ID +func (id UserDefinedFunctionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Sql Database Name: %q", id.SqlDatabaseName), + fmt.Sprintf("Container Name: %q", id.ContainerName), + fmt.Sprintf("User Defined Function Name: %q", id.UserDefinedFunctionName), + } + return fmt.Sprintf("User Defined Function (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandrakeyspace_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandrakeyspace_autorest.go new file mode 100644 index 000000000000..1b91999ec8af --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandrakeyspace_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesCreateUpdateCassandraKeyspaceOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesCreateUpdateCassandraKeyspace ... +func (c CosmosDBClient) CassandraResourcesCreateUpdateCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId, input CassandraKeyspaceCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraKeyspaceOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesCreateUpdateCassandraKeyspace(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesCreateUpdateCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesCreateUpdateCassandraKeyspace(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesCreateUpdateCassandraKeyspace", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll performs CassandraResourcesCreateUpdateCassandraKeyspace then polls until it's completed +func (c CosmosDBClient) CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx context.Context, id CassandraKeyspaceId, input CassandraKeyspaceCreateUpdateParameters) error { + result, err := c.CassandraResourcesCreateUpdateCassandraKeyspace(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CassandraResourcesCreateUpdateCassandraKeyspace: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesCreateUpdateCassandraKeyspace: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesCreateUpdateCassandraKeyspace prepares the CassandraResourcesCreateUpdateCassandraKeyspace request. +func (c CosmosDBClient) preparerForCassandraResourcesCreateUpdateCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId, input CassandraKeyspaceCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesCreateUpdateCassandraKeyspace sends the CassandraResourcesCreateUpdateCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesCreateUpdateCassandraKeyspace(ctx context.Context, req *http.Request) (future CassandraResourcesCreateUpdateCassandraKeyspaceOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandratable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandratable_autorest.go new file mode 100644 index 000000000000..e5f7e872bfa0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcescreateupdatecassandratable_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesCreateUpdateCassandraTableOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesCreateUpdateCassandraTable ... +func (c CosmosDBClient) CassandraResourcesCreateUpdateCassandraTable(ctx context.Context, id CassandraKeyspaceTableId, input CassandraTableCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraTableOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesCreateUpdateCassandraTable(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesCreateUpdateCassandraTable", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesCreateUpdateCassandraTable(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesCreateUpdateCassandraTable", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesCreateUpdateCassandraTableThenPoll performs CassandraResourcesCreateUpdateCassandraTable then polls until it's completed +func (c CosmosDBClient) CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx context.Context, id CassandraKeyspaceTableId, input CassandraTableCreateUpdateParameters) error { + result, err := c.CassandraResourcesCreateUpdateCassandraTable(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CassandraResourcesCreateUpdateCassandraTable: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesCreateUpdateCassandraTable: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesCreateUpdateCassandraTable prepares the CassandraResourcesCreateUpdateCassandraTable request. +func (c CosmosDBClient) preparerForCassandraResourcesCreateUpdateCassandraTable(ctx context.Context, id CassandraKeyspaceTableId, input CassandraTableCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesCreateUpdateCassandraTable sends the CassandraResourcesCreateUpdateCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesCreateUpdateCassandraTable(ctx context.Context, req *http.Request) (future CassandraResourcesCreateUpdateCassandraTableOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandrakeyspace_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandrakeyspace_autorest.go new file mode 100644 index 000000000000..705c9ce60478 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandrakeyspace_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesDeleteCassandraKeyspaceOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesDeleteCassandraKeyspace ... +func (c CosmosDBClient) CassandraResourcesDeleteCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesDeleteCassandraKeyspaceOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesDeleteCassandraKeyspace(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesDeleteCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesDeleteCassandraKeyspace(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesDeleteCassandraKeyspace", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesDeleteCassandraKeyspaceThenPoll performs CassandraResourcesDeleteCassandraKeyspace then polls until it's completed +func (c CosmosDBClient) CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx context.Context, id CassandraKeyspaceId) error { + result, err := c.CassandraResourcesDeleteCassandraKeyspace(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesDeleteCassandraKeyspace: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesDeleteCassandraKeyspace: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesDeleteCassandraKeyspace prepares the CassandraResourcesDeleteCassandraKeyspace request. +func (c CosmosDBClient) preparerForCassandraResourcesDeleteCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesDeleteCassandraKeyspace sends the CassandraResourcesDeleteCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesDeleteCassandraKeyspace(ctx context.Context, req *http.Request) (future CassandraResourcesDeleteCassandraKeyspaceOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandratable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandratable_autorest.go new file mode 100644 index 000000000000..e64f4bc122ab --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesdeletecassandratable_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesDeleteCassandraTableOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesDeleteCassandraTable ... +func (c CosmosDBClient) CassandraResourcesDeleteCassandraTable(ctx context.Context, id CassandraKeyspaceTableId) (result CassandraResourcesDeleteCassandraTableOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesDeleteCassandraTable(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesDeleteCassandraTable", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesDeleteCassandraTable(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesDeleteCassandraTable", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesDeleteCassandraTableThenPoll performs CassandraResourcesDeleteCassandraTable then polls until it's completed +func (c CosmosDBClient) CassandraResourcesDeleteCassandraTableThenPoll(ctx context.Context, id CassandraKeyspaceTableId) error { + result, err := c.CassandraResourcesDeleteCassandraTable(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesDeleteCassandraTable: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesDeleteCassandraTable: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesDeleteCassandraTable prepares the CassandraResourcesDeleteCassandraTable request. +func (c CosmosDBClient) preparerForCassandraResourcesDeleteCassandraTable(ctx context.Context, id CassandraKeyspaceTableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesDeleteCassandraTable sends the CassandraResourcesDeleteCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesDeleteCassandraTable(ctx context.Context, req *http.Request) (future CassandraResourcesDeleteCassandraTableOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspace_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspace_autorest.go new file mode 100644 index 000000000000..e8596602b310 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspace_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesGetCassandraKeyspaceOperationResponse struct { + HttpResponse *http.Response + Model *CassandraKeyspaceGetResults +} + +// CassandraResourcesGetCassandraKeyspace ... +func (c CosmosDBClient) CassandraResourcesGetCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesGetCassandraKeyspaceOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesGetCassandraKeyspace(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspace", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspace", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesGetCassandraKeyspace(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspace", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesGetCassandraKeyspace prepares the CassandraResourcesGetCassandraKeyspace request. +func (c CosmosDBClient) preparerForCassandraResourcesGetCassandraKeyspace(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesGetCassandraKeyspace handles the response to the CassandraResourcesGetCassandraKeyspace request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesGetCassandraKeyspace(resp *http.Response) (result CassandraResourcesGetCassandraKeyspaceOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspacethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspacethroughput_autorest.go new file mode 100644 index 000000000000..4de5338d6415 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandrakeyspacethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesGetCassandraKeyspaceThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// CassandraResourcesGetCassandraKeyspaceThroughput ... +func (c CosmosDBClient) CassandraResourcesGetCassandraKeyspaceThroughput(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesGetCassandraKeyspaceThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspaceThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesGetCassandraKeyspaceThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraKeyspaceThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesGetCassandraKeyspaceThroughput prepares the CassandraResourcesGetCassandraKeyspaceThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesGetCassandraKeyspaceThroughput(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesGetCassandraKeyspaceThroughput handles the response to the CassandraResourcesGetCassandraKeyspaceThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesGetCassandraKeyspaceThroughput(resp *http.Response) (result CassandraResourcesGetCassandraKeyspaceThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratable_autorest.go new file mode 100644 index 000000000000..32fbbed4fe09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratable_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesGetCassandraTableOperationResponse struct { + HttpResponse *http.Response + Model *CassandraTableGetResults +} + +// CassandraResourcesGetCassandraTable ... +func (c CosmosDBClient) CassandraResourcesGetCassandraTable(ctx context.Context, id CassandraKeyspaceTableId) (result CassandraResourcesGetCassandraTableOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesGetCassandraTable(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTable", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTable", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesGetCassandraTable(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTable", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesGetCassandraTable prepares the CassandraResourcesGetCassandraTable request. +func (c CosmosDBClient) preparerForCassandraResourcesGetCassandraTable(ctx context.Context, id CassandraKeyspaceTableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesGetCassandraTable handles the response to the CassandraResourcesGetCassandraTable request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesGetCassandraTable(resp *http.Response) (result CassandraResourcesGetCassandraTableOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratablethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratablethroughput_autorest.go new file mode 100644 index 000000000000..1d3654dbaed4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesgetcassandratablethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesGetCassandraTableThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// CassandraResourcesGetCassandraTableThroughput ... +func (c CosmosDBClient) CassandraResourcesGetCassandraTableThroughput(ctx context.Context, id CassandraKeyspaceTableId) (result CassandraResourcesGetCassandraTableThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesGetCassandraTableThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTableThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTableThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesGetCassandraTableThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesGetCassandraTableThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesGetCassandraTableThroughput prepares the CassandraResourcesGetCassandraTableThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesGetCassandraTableThroughput(ctx context.Context, id CassandraKeyspaceTableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesGetCassandraTableThroughput handles the response to the CassandraResourcesGetCassandraTableThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesGetCassandraTableThroughput(resp *http.Response) (result CassandraResourcesGetCassandraTableThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandrakeyspaces_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandrakeyspaces_autorest.go new file mode 100644 index 000000000000..e3c52261b422 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandrakeyspaces_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesListCassandraKeyspacesOperationResponse struct { + HttpResponse *http.Response + Model *CassandraKeyspaceListResult +} + +// CassandraResourcesListCassandraKeyspaces ... +func (c CosmosDBClient) CassandraResourcesListCassandraKeyspaces(ctx context.Context, id DatabaseAccountId) (result CassandraResourcesListCassandraKeyspacesOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesListCassandraKeyspaces(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraKeyspaces", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraKeyspaces", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesListCassandraKeyspaces(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraKeyspaces", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesListCassandraKeyspaces prepares the CassandraResourcesListCassandraKeyspaces request. +func (c CosmosDBClient) preparerForCassandraResourcesListCassandraKeyspaces(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/cassandraKeyspaces", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesListCassandraKeyspaces handles the response to the CassandraResourcesListCassandraKeyspaces request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesListCassandraKeyspaces(resp *http.Response) (result CassandraResourcesListCassandraKeyspacesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandratables_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandratables_autorest.go new file mode 100644 index 000000000000..4d827d86b4f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourceslistcassandratables_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesListCassandraTablesOperationResponse struct { + HttpResponse *http.Response + Model *CassandraTableListResult +} + +// CassandraResourcesListCassandraTables ... +func (c CosmosDBClient) CassandraResourcesListCassandraTables(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesListCassandraTablesOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesListCassandraTables(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraTables", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraTables", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCassandraResourcesListCassandraTables(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesListCassandraTables", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCassandraResourcesListCassandraTables prepares the CassandraResourcesListCassandraTables request. +func (c CosmosDBClient) preparerForCassandraResourcesListCassandraTables(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/tables", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCassandraResourcesListCassandraTables handles the response to the CassandraResourcesListCassandraTables request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCassandraResourcesListCassandraTables(resp *http.Response) (result CassandraResourcesListCassandraTablesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetoautoscale_autorest.go new file mode 100644 index 000000000000..8f9f2c2097ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesMigrateCassandraKeyspaceToAutoscale ... +func (c CosmosDBClient) CassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesMigrateCassandraKeyspaceToAutoscaleOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraKeyspaceToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraKeyspaceToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll performs CassandraResourcesMigrateCassandraKeyspaceToAutoscale then polls until it's completed +func (c CosmosDBClient) CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx context.Context, id CassandraKeyspaceId) error { + result, err := c.CassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesMigrateCassandraKeyspaceToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesMigrateCassandraKeyspaceToAutoscale: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesMigrateCassandraKeyspaceToAutoscale prepares the CassandraResourcesMigrateCassandraKeyspaceToAutoscale request. +func (c CosmosDBClient) preparerForCassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesMigrateCassandraKeyspaceToAutoscale sends the CassandraResourcesMigrateCassandraKeyspaceToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesMigrateCassandraKeyspaceToAutoscale(ctx context.Context, req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetomanualthroughput_autorest.go new file mode 100644 index 000000000000..c40dbed9ea26 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandrakeyspacetomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesMigrateCassandraKeyspaceToManualThroughput ... +func (c CosmosDBClient) CassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx context.Context, id CassandraKeyspaceId) (result CassandraResourcesMigrateCassandraKeyspaceToManualThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraKeyspaceToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraKeyspaceToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll performs CassandraResourcesMigrateCassandraKeyspaceToManualThroughput then polls until it's completed +func (c CosmosDBClient) CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx context.Context, id CassandraKeyspaceId) error { + result, err := c.CassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesMigrateCassandraKeyspaceToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesMigrateCassandraKeyspaceToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput prepares the CassandraResourcesMigrateCassandraKeyspaceToManualThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx context.Context, id CassandraKeyspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput sends the CassandraResourcesMigrateCassandraKeyspaceToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesMigrateCassandraKeyspaceToManualThroughput(ctx context.Context, req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletoautoscale_autorest.go new file mode 100644 index 000000000000..69ce38e44055 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesMigrateCassandraTableToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesMigrateCassandraTableToAutoscale ... +func (c CosmosDBClient) CassandraResourcesMigrateCassandraTableToAutoscale(ctx context.Context, id CassandraKeyspaceTableId) (result CassandraResourcesMigrateCassandraTableToAutoscaleOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesMigrateCassandraTableToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesMigrateCassandraTableToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraTableToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll performs CassandraResourcesMigrateCassandraTableToAutoscale then polls until it's completed +func (c CosmosDBClient) CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx context.Context, id CassandraKeyspaceTableId) error { + result, err := c.CassandraResourcesMigrateCassandraTableToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesMigrateCassandraTableToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesMigrateCassandraTableToAutoscale: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesMigrateCassandraTableToAutoscale prepares the CassandraResourcesMigrateCassandraTableToAutoscale request. +func (c CosmosDBClient) preparerForCassandraResourcesMigrateCassandraTableToAutoscale(ctx context.Context, id CassandraKeyspaceTableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesMigrateCassandraTableToAutoscale sends the CassandraResourcesMigrateCassandraTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesMigrateCassandraTableToAutoscale(ctx context.Context, req *http.Request) (future CassandraResourcesMigrateCassandraTableToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletomanualthroughput_autorest.go new file mode 100644 index 000000000000..1af3a6aecfff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesmigratecassandratabletomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesMigrateCassandraTableToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesMigrateCassandraTableToManualThroughput ... +func (c CosmosDBClient) CassandraResourcesMigrateCassandraTableToManualThroughput(ctx context.Context, id CassandraKeyspaceTableId) (result CassandraResourcesMigrateCassandraTableToManualThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesMigrateCassandraTableToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesMigrateCassandraTableToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesMigrateCassandraTableToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll performs CassandraResourcesMigrateCassandraTableToManualThroughput then polls until it's completed +func (c CosmosDBClient) CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx context.Context, id CassandraKeyspaceTableId) error { + result, err := c.CassandraResourcesMigrateCassandraTableToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing CassandraResourcesMigrateCassandraTableToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesMigrateCassandraTableToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesMigrateCassandraTableToManualThroughput prepares the CassandraResourcesMigrateCassandraTableToManualThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesMigrateCassandraTableToManualThroughput(ctx context.Context, id CassandraKeyspaceTableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesMigrateCassandraTableToManualThroughput sends the CassandraResourcesMigrateCassandraTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesMigrateCassandraTableToManualThroughput(ctx context.Context, req *http.Request) (future CassandraResourcesMigrateCassandraTableToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandrakeyspacethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandrakeyspacethroughput_autorest.go new file mode 100644 index 000000000000..297abd715ec2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandrakeyspacethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesUpdateCassandraKeyspaceThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesUpdateCassandraKeyspaceThroughput ... +func (c CosmosDBClient) CassandraResourcesUpdateCassandraKeyspaceThroughput(ctx context.Context, id CassandraKeyspaceId, input ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraKeyspaceThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesUpdateCassandraKeyspaceThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesUpdateCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesUpdateCassandraKeyspaceThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesUpdateCassandraKeyspaceThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll performs CassandraResourcesUpdateCassandraKeyspaceThroughput then polls until it's completed +func (c CosmosDBClient) CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx context.Context, id CassandraKeyspaceId, input ThroughputSettingsUpdateParameters) error { + result, err := c.CassandraResourcesUpdateCassandraKeyspaceThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CassandraResourcesUpdateCassandraKeyspaceThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesUpdateCassandraKeyspaceThroughput: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesUpdateCassandraKeyspaceThroughput prepares the CassandraResourcesUpdateCassandraKeyspaceThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesUpdateCassandraKeyspaceThroughput(ctx context.Context, id CassandraKeyspaceId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesUpdateCassandraKeyspaceThroughput sends the CassandraResourcesUpdateCassandraKeyspaceThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesUpdateCassandraKeyspaceThroughput(ctx context.Context, req *http.Request) (future CassandraResourcesUpdateCassandraKeyspaceThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandratablethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandratablethroughput_autorest.go new file mode 100644 index 000000000000..f4b122724181 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_cassandraresourcesupdatecassandratablethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraResourcesUpdateCassandraTableThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CassandraResourcesUpdateCassandraTableThroughput ... +func (c CosmosDBClient) CassandraResourcesUpdateCassandraTableThroughput(ctx context.Context, id CassandraKeyspaceTableId, input ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraTableThroughputOperationResponse, err error) { + req, err := c.preparerForCassandraResourcesUpdateCassandraTableThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesUpdateCassandraTableThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForCassandraResourcesUpdateCassandraTableThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CassandraResourcesUpdateCassandraTableThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CassandraResourcesUpdateCassandraTableThroughputThenPoll performs CassandraResourcesUpdateCassandraTableThroughput then polls until it's completed +func (c CosmosDBClient) CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx context.Context, id CassandraKeyspaceTableId, input ThroughputSettingsUpdateParameters) error { + result, err := c.CassandraResourcesUpdateCassandraTableThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CassandraResourcesUpdateCassandraTableThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CassandraResourcesUpdateCassandraTableThroughput: %+v", err) + } + + return nil +} + +// preparerForCassandraResourcesUpdateCassandraTableThroughput prepares the CassandraResourcesUpdateCassandraTableThroughput request. +func (c CosmosDBClient) preparerForCassandraResourcesUpdateCassandraTableThroughput(ctx context.Context, id CassandraKeyspaceTableId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCassandraResourcesUpdateCassandraTableThroughput sends the CassandraResourcesUpdateCassandraTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForCassandraResourcesUpdateCassandraTableThroughput(ctx context.Context, req *http.Request) (future CassandraResourcesUpdateCassandraTableThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetricdefinitions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetricdefinitions_autorest.go new file mode 100644 index 000000000000..2638301287a3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetricdefinitions_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionListMetricDefinitionsOperationResponse struct { + HttpResponse *http.Response + Model *MetricDefinitionsListResult +} + +// CollectionListMetricDefinitions ... +func (c CosmosDBClient) CollectionListMetricDefinitions(ctx context.Context, id CollectionId) (result CollectionListMetricDefinitionsOperationResponse, err error) { + req, err := c.preparerForCollectionListMetricDefinitions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetricDefinitions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetricDefinitions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionListMetricDefinitions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetricDefinitions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionListMetricDefinitions prepares the CollectionListMetricDefinitions request. +func (c CosmosDBClient) preparerForCollectionListMetricDefinitions(ctx context.Context, id CollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/metricDefinitions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionListMetricDefinitions handles the response to the CollectionListMetricDefinitions request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionListMetricDefinitions(resp *http.Response) (result CollectionListMetricDefinitionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetrics_autorest.go new file mode 100644 index 000000000000..4287eb608aac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *MetricListResult +} + +type CollectionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultCollectionListMetricsOperationOptions() CollectionListMetricsOperationOptions { + return CollectionListMetricsOperationOptions{} +} + +func (o CollectionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionListMetrics ... +func (c CosmosDBClient) CollectionListMetrics(ctx context.Context, id CollectionId, options CollectionListMetricsOperationOptions) (result CollectionListMetricsOperationResponse, err error) { + req, err := c.preparerForCollectionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionListMetrics prepares the CollectionListMetrics request. +func (c CosmosDBClient) preparerForCollectionListMetrics(ctx context.Context, id CollectionId, options CollectionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionListMetrics handles the response to the CollectionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionListMetrics(resp *http.Response) (result CollectionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistusages_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistusages_autorest.go new file mode 100644 index 000000000000..449ceff726e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionlistusages_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionListUsagesOperationResponse struct { + HttpResponse *http.Response + Model *UsagesResult +} + +type CollectionListUsagesOperationOptions struct { + Filter *string +} + +func DefaultCollectionListUsagesOperationOptions() CollectionListUsagesOperationOptions { + return CollectionListUsagesOperationOptions{} +} + +func (o CollectionListUsagesOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionListUsagesOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionListUsages ... +func (c CosmosDBClient) CollectionListUsages(ctx context.Context, id CollectionId, options CollectionListUsagesOperationOptions) (result CollectionListUsagesOperationResponse, err error) { + req, err := c.preparerForCollectionListUsages(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListUsages", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListUsages", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionListUsages(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionListUsages", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionListUsages prepares the CollectionListUsages request. +func (c CosmosDBClient) preparerForCollectionListUsages(ctx context.Context, id CollectionId, options CollectionListUsagesOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/usages", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionListUsages handles the response to the CollectionListUsages request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionListUsages(resp *http.Response) (result CollectionListUsagesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistmetrics_autorest.go new file mode 100644 index 000000000000..3caf7eea6b9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionPartitionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PartitionMetricListResult +} + +type CollectionPartitionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultCollectionPartitionListMetricsOperationOptions() CollectionPartitionListMetricsOperationOptions { + return CollectionPartitionListMetricsOperationOptions{} +} + +func (o CollectionPartitionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionPartitionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionPartitionListMetrics ... +func (c CosmosDBClient) CollectionPartitionListMetrics(ctx context.Context, id CollectionId, options CollectionPartitionListMetricsOperationOptions) (result CollectionPartitionListMetricsOperationResponse, err error) { + req, err := c.preparerForCollectionPartitionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionPartitionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionPartitionListMetrics prepares the CollectionPartitionListMetrics request. +func (c CosmosDBClient) preparerForCollectionPartitionListMetrics(ctx context.Context, id CollectionId, options CollectionPartitionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/partitions/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionPartitionListMetrics handles the response to the CollectionPartitionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionPartitionListMetrics(resp *http.Response) (result CollectionPartitionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistusages_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistusages_autorest.go new file mode 100644 index 000000000000..f9db2b339972 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionlistusages_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionPartitionListUsagesOperationResponse struct { + HttpResponse *http.Response + Model *PartitionUsagesResult +} + +type CollectionPartitionListUsagesOperationOptions struct { + Filter *string +} + +func DefaultCollectionPartitionListUsagesOperationOptions() CollectionPartitionListUsagesOperationOptions { + return CollectionPartitionListUsagesOperationOptions{} +} + +func (o CollectionPartitionListUsagesOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionPartitionListUsagesOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionPartitionListUsages ... +func (c CosmosDBClient) CollectionPartitionListUsages(ctx context.Context, id CollectionId, options CollectionPartitionListUsagesOperationOptions) (result CollectionPartitionListUsagesOperationResponse, err error) { + req, err := c.preparerForCollectionPartitionListUsages(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListUsages", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListUsages", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionPartitionListUsages(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionListUsages", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionPartitionListUsages prepares the CollectionPartitionListUsages request. +func (c CosmosDBClient) preparerForCollectionPartitionListUsages(ctx context.Context, id CollectionId, options CollectionPartitionListUsagesOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/partitions/usages", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionPartitionListUsages handles the response to the CollectionPartitionListUsages request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionPartitionListUsages(resp *http.Response) (result CollectionPartitionListUsagesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionregionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionregionlistmetrics_autorest.go new file mode 100644 index 000000000000..0da9bef8aad0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionpartitionregionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionPartitionRegionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PartitionMetricListResult +} + +type CollectionPartitionRegionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultCollectionPartitionRegionListMetricsOperationOptions() CollectionPartitionRegionListMetricsOperationOptions { + return CollectionPartitionRegionListMetricsOperationOptions{} +} + +func (o CollectionPartitionRegionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionPartitionRegionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionPartitionRegionListMetrics ... +func (c CosmosDBClient) CollectionPartitionRegionListMetrics(ctx context.Context, id DatabaseCollectionId, options CollectionPartitionRegionListMetricsOperationOptions) (result CollectionPartitionRegionListMetricsOperationResponse, err error) { + req, err := c.preparerForCollectionPartitionRegionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionRegionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionRegionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionPartitionRegionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionPartitionRegionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionPartitionRegionListMetrics prepares the CollectionPartitionRegionListMetrics request. +func (c CosmosDBClient) preparerForCollectionPartitionRegionListMetrics(ctx context.Context, id DatabaseCollectionId, options CollectionPartitionRegionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/partitions/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionPartitionRegionListMetrics handles the response to the CollectionPartitionRegionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionPartitionRegionListMetrics(resp *http.Response) (result CollectionPartitionRegionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionregionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionregionlistmetrics_autorest.go new file mode 100644 index 000000000000..6a3cc906be23 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_collectionregionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CollectionRegionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *MetricListResult +} + +type CollectionRegionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultCollectionRegionListMetricsOperationOptions() CollectionRegionListMetricsOperationOptions { + return CollectionRegionListMetricsOperationOptions{} +} + +func (o CollectionRegionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o CollectionRegionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// CollectionRegionListMetrics ... +func (c CosmosDBClient) CollectionRegionListMetrics(ctx context.Context, id DatabaseCollectionId, options CollectionRegionListMetricsOperationOptions) (result CollectionRegionListMetricsOperationResponse, err error) { + req, err := c.preparerForCollectionRegionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionRegionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionRegionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCollectionRegionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "CollectionRegionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCollectionRegionListMetrics prepares the CollectionRegionListMetrics request. +func (c CosmosDBClient) preparerForCollectionRegionListMetrics(ctx context.Context, id DatabaseCollectionId, options CollectionRegionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCollectionRegionListMetrics handles the response to the CollectionRegionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForCollectionRegionListMetrics(resp *http.Response) (result CollectionRegionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountregionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountregionlistmetrics_autorest.go new file mode 100644 index 000000000000..8e8f62e6c1bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountregionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountRegionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *MetricListResult +} + +type DatabaseAccountRegionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultDatabaseAccountRegionListMetricsOperationOptions() DatabaseAccountRegionListMetricsOperationOptions { + return DatabaseAccountRegionListMetricsOperationOptions{} +} + +func (o DatabaseAccountRegionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DatabaseAccountRegionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// DatabaseAccountRegionListMetrics ... +func (c CosmosDBClient) DatabaseAccountRegionListMetrics(ctx context.Context, id RegionId, options DatabaseAccountRegionListMetricsOperationOptions) (result DatabaseAccountRegionListMetricsOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountRegionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountRegionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountRegionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountRegionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountRegionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountRegionListMetrics prepares the DatabaseAccountRegionListMetrics request. +func (c CosmosDBClient) preparerForDatabaseAccountRegionListMetrics(ctx context.Context, id RegionId, options DatabaseAccountRegionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountRegionListMetrics handles the response to the DatabaseAccountRegionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountRegionListMetrics(resp *http.Response) (result DatabaseAccountRegionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountschecknameexists_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountschecknameexists_autorest.go new file mode 100644 index 000000000000..71d553817f4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountschecknameexists_autorest.go @@ -0,0 +1,66 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsCheckNameExistsOperationResponse struct { + HttpResponse *http.Response +} + +// DatabaseAccountsCheckNameExists ... +func (c CosmosDBClient) DatabaseAccountsCheckNameExists(ctx context.Context, id DatabaseAccountNameId) (result DatabaseAccountsCheckNameExistsOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsCheckNameExists(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsCheckNameExists", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsCheckNameExists", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsCheckNameExists(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsCheckNameExists", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsCheckNameExists prepares the DatabaseAccountsCheckNameExists request. +func (c CosmosDBClient) preparerForDatabaseAccountsCheckNameExists(ctx context.Context, id DatabaseAccountNameId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsHead(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsCheckNameExists handles the response to the DatabaseAccountsCheckNameExists request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsCheckNameExists(resp *http.Response) (result DatabaseAccountsCheckNameExistsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountscreateorupdate_autorest.go new file mode 100644 index 000000000000..6d2931a860c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountscreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsCreateOrUpdate ... +func (c CosmosDBClient) DatabaseAccountsCreateOrUpdate(ctx context.Context, id DatabaseAccountId, input DatabaseAccountCreateUpdateParameters) (result DatabaseAccountsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsCreateOrUpdateThenPoll performs DatabaseAccountsCreateOrUpdate then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsCreateOrUpdateThenPoll(ctx context.Context, id DatabaseAccountId, input DatabaseAccountCreateUpdateParameters) error { + result, err := c.DatabaseAccountsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsCreateOrUpdate prepares the DatabaseAccountsCreateOrUpdate request. +func (c CosmosDBClient) preparerForDatabaseAccountsCreateOrUpdate(ctx context.Context, id DatabaseAccountId, input DatabaseAccountCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsCreateOrUpdate sends the DatabaseAccountsCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsCreateOrUpdate(ctx context.Context, req *http.Request) (future DatabaseAccountsCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsdelete_autorest.go new file mode 100644 index 000000000000..bed37f274594 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsdelete_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsDelete ... +func (c CosmosDBClient) DatabaseAccountsDelete(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsDeleteOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsDeleteThenPoll performs DatabaseAccountsDelete then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsDeleteThenPoll(ctx context.Context, id DatabaseAccountId) error { + result, err := c.DatabaseAccountsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsDelete: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsDelete prepares the DatabaseAccountsDelete request. +func (c CosmosDBClient) preparerForDatabaseAccountsDelete(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsDelete sends the DatabaseAccountsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsDelete(ctx context.Context, req *http.Request) (future DatabaseAccountsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsfailoverprioritychange_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsfailoverprioritychange_autorest.go new file mode 100644 index 000000000000..5e5bdc4ac145 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsfailoverprioritychange_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsFailoverPriorityChangeOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsFailoverPriorityChange ... +func (c CosmosDBClient) DatabaseAccountsFailoverPriorityChange(ctx context.Context, id DatabaseAccountId, input FailoverPolicies) (result DatabaseAccountsFailoverPriorityChangeOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsFailoverPriorityChange(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsFailoverPriorityChange", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsFailoverPriorityChange(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsFailoverPriorityChange", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsFailoverPriorityChangeThenPoll performs DatabaseAccountsFailoverPriorityChange then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsFailoverPriorityChangeThenPoll(ctx context.Context, id DatabaseAccountId, input FailoverPolicies) error { + result, err := c.DatabaseAccountsFailoverPriorityChange(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsFailoverPriorityChange: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsFailoverPriorityChange: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsFailoverPriorityChange prepares the DatabaseAccountsFailoverPriorityChange request. +func (c CosmosDBClient) preparerForDatabaseAccountsFailoverPriorityChange(ctx context.Context, id DatabaseAccountId, input FailoverPolicies) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/failoverPriorityChange", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsFailoverPriorityChange sends the DatabaseAccountsFailoverPriorityChange request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsFailoverPriorityChange(ctx context.Context, req *http.Request) (future DatabaseAccountsFailoverPriorityChangeOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsget_autorest.go new file mode 100644 index 000000000000..2a50f4451fa1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsget_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsGetOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountGetResults +} + +// DatabaseAccountsGet ... +func (c CosmosDBClient) DatabaseAccountsGet(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsGetOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsGet prepares the DatabaseAccountsGet request. +func (c CosmosDBClient) preparerForDatabaseAccountsGet(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsGet handles the response to the DatabaseAccountsGet request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsGet(resp *http.Response) (result DatabaseAccountsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsgetreadonlykeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsgetreadonlykeys_autorest.go new file mode 100644 index 000000000000..02170f169a5e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsgetreadonlykeys_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsGetReadOnlyKeysOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountListReadOnlyKeysResult +} + +// DatabaseAccountsGetReadOnlyKeys ... +func (c CosmosDBClient) DatabaseAccountsGetReadOnlyKeys(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsGetReadOnlyKeysOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsGetReadOnlyKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGetReadOnlyKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGetReadOnlyKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsGetReadOnlyKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsGetReadOnlyKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsGetReadOnlyKeys prepares the DatabaseAccountsGetReadOnlyKeys request. +func (c CosmosDBClient) preparerForDatabaseAccountsGetReadOnlyKeys(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/readonlykeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsGetReadOnlyKeys handles the response to the DatabaseAccountsGetReadOnlyKeys request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsGetReadOnlyKeys(resp *http.Response) (result DatabaseAccountsGetReadOnlyKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslist_autorest.go new file mode 100644 index 000000000000..b29f637aeae7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslist_autorest.go @@ -0,0 +1,70 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountsListResult +} + +// DatabaseAccountsList ... +func (c CosmosDBClient) DatabaseAccountsList(ctx context.Context, id commonids.SubscriptionId) (result DatabaseAccountsListOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsList", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsList prepares the DatabaseAccountsList request. +func (c CosmosDBClient) preparerForDatabaseAccountsList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DocumentDB/databaseAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsList handles the response to the DatabaseAccountsList request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsList(resp *http.Response) (result DatabaseAccountsListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistbyresourcegroup_autorest.go new file mode 100644 index 000000000000..fcb917b950da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistbyresourcegroup_autorest.go @@ -0,0 +1,70 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountsListResult +} + +// DatabaseAccountsListByResourceGroup ... +func (c CosmosDBClient) DatabaseAccountsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result DatabaseAccountsListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListByResourceGroup(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListByResourceGroup prepares the DatabaseAccountsListByResourceGroup request. +func (c CosmosDBClient) preparerForDatabaseAccountsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DocumentDB/databaseAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListByResourceGroup handles the response to the DatabaseAccountsListByResourceGroup request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListByResourceGroup(resp *http.Response) (result DatabaseAccountsListByResourceGroupOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistconnectionstrings_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistconnectionstrings_autorest.go new file mode 100644 index 000000000000..7f351d14d22f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistconnectionstrings_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListConnectionStringsOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountListConnectionStringsResult +} + +// DatabaseAccountsListConnectionStrings ... +func (c CosmosDBClient) DatabaseAccountsListConnectionStrings(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsListConnectionStringsOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListConnectionStrings(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListConnectionStrings", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListConnectionStrings", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListConnectionStrings(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListConnectionStrings", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListConnectionStrings prepares the DatabaseAccountsListConnectionStrings request. +func (c CosmosDBClient) preparerForDatabaseAccountsListConnectionStrings(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listConnectionStrings", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListConnectionStrings handles the response to the DatabaseAccountsListConnectionStrings request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListConnectionStrings(resp *http.Response) (result DatabaseAccountsListConnectionStringsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistkeys_autorest.go new file mode 100644 index 000000000000..22fc564ce56c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistkeys_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListKeysOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountListKeysResult +} + +// DatabaseAccountsListKeys ... +func (c CosmosDBClient) DatabaseAccountsListKeys(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsListKeysOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListKeys prepares the DatabaseAccountsListKeys request. +func (c CosmosDBClient) preparerForDatabaseAccountsListKeys(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listKeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListKeys handles the response to the DatabaseAccountsListKeys request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListKeys(resp *http.Response) (result DatabaseAccountsListKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetricdefinitions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetricdefinitions_autorest.go new file mode 100644 index 000000000000..4d4b0d387a98 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetricdefinitions_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListMetricDefinitionsOperationResponse struct { + HttpResponse *http.Response + Model *MetricDefinitionsListResult +} + +// DatabaseAccountsListMetricDefinitions ... +func (c CosmosDBClient) DatabaseAccountsListMetricDefinitions(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsListMetricDefinitionsOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListMetricDefinitions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetricDefinitions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetricDefinitions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListMetricDefinitions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetricDefinitions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListMetricDefinitions prepares the DatabaseAccountsListMetricDefinitions request. +func (c CosmosDBClient) preparerForDatabaseAccountsListMetricDefinitions(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/metricDefinitions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListMetricDefinitions handles the response to the DatabaseAccountsListMetricDefinitions request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListMetricDefinitions(resp *http.Response) (result DatabaseAccountsListMetricDefinitionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetrics_autorest.go new file mode 100644 index 000000000000..3f66e00457e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *MetricListResult +} + +type DatabaseAccountsListMetricsOperationOptions struct { + Filter *string +} + +func DefaultDatabaseAccountsListMetricsOperationOptions() DatabaseAccountsListMetricsOperationOptions { + return DatabaseAccountsListMetricsOperationOptions{} +} + +func (o DatabaseAccountsListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DatabaseAccountsListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// DatabaseAccountsListMetrics ... +func (c CosmosDBClient) DatabaseAccountsListMetrics(ctx context.Context, id DatabaseAccountId, options DatabaseAccountsListMetricsOperationOptions) (result DatabaseAccountsListMetricsOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListMetrics prepares the DatabaseAccountsListMetrics request. +func (c CosmosDBClient) preparerForDatabaseAccountsListMetrics(ctx context.Context, id DatabaseAccountId, options DatabaseAccountsListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListMetrics handles the response to the DatabaseAccountsListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListMetrics(resp *http.Response) (result DatabaseAccountsListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistreadonlykeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistreadonlykeys_autorest.go new file mode 100644 index 000000000000..afe132df8e65 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistreadonlykeys_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListReadOnlyKeysOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseAccountListReadOnlyKeysResult +} + +// DatabaseAccountsListReadOnlyKeys ... +func (c CosmosDBClient) DatabaseAccountsListReadOnlyKeys(ctx context.Context, id DatabaseAccountId) (result DatabaseAccountsListReadOnlyKeysOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListReadOnlyKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListReadOnlyKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListReadOnlyKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListReadOnlyKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListReadOnlyKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListReadOnlyKeys prepares the DatabaseAccountsListReadOnlyKeys request. +func (c CosmosDBClient) preparerForDatabaseAccountsListReadOnlyKeys(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/readonlykeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListReadOnlyKeys handles the response to the DatabaseAccountsListReadOnlyKeys request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListReadOnlyKeys(resp *http.Response) (result DatabaseAccountsListReadOnlyKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistusages_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistusages_autorest.go new file mode 100644 index 000000000000..ce3963788a44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountslistusages_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListUsagesOperationResponse struct { + HttpResponse *http.Response + Model *UsagesResult +} + +type DatabaseAccountsListUsagesOperationOptions struct { + Filter *string +} + +func DefaultDatabaseAccountsListUsagesOperationOptions() DatabaseAccountsListUsagesOperationOptions { + return DatabaseAccountsListUsagesOperationOptions{} +} + +func (o DatabaseAccountsListUsagesOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DatabaseAccountsListUsagesOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// DatabaseAccountsListUsages ... +func (c CosmosDBClient) DatabaseAccountsListUsages(ctx context.Context, id DatabaseAccountId, options DatabaseAccountsListUsagesOperationOptions) (result DatabaseAccountsListUsagesOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsListUsages(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListUsages", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListUsages", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseAccountsListUsages(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsListUsages", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseAccountsListUsages prepares the DatabaseAccountsListUsages request. +func (c CosmosDBClient) preparerForDatabaseAccountsListUsages(ctx context.Context, id DatabaseAccountId, options DatabaseAccountsListUsagesOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/usages", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseAccountsListUsages handles the response to the DatabaseAccountsListUsages request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseAccountsListUsages(resp *http.Response) (result DatabaseAccountsListUsagesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsofflineregion_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsofflineregion_autorest.go new file mode 100644 index 000000000000..97c844276912 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsofflineregion_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsOfflineRegionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsOfflineRegion ... +func (c CosmosDBClient) DatabaseAccountsOfflineRegion(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) (result DatabaseAccountsOfflineRegionOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsOfflineRegion(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsOfflineRegion", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsOfflineRegion(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsOfflineRegion", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsOfflineRegionThenPoll performs DatabaseAccountsOfflineRegion then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsOfflineRegionThenPoll(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) error { + result, err := c.DatabaseAccountsOfflineRegion(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsOfflineRegion: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsOfflineRegion: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsOfflineRegion prepares the DatabaseAccountsOfflineRegion request. +func (c CosmosDBClient) preparerForDatabaseAccountsOfflineRegion(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/offlineRegion", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsOfflineRegion sends the DatabaseAccountsOfflineRegion request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsOfflineRegion(ctx context.Context, req *http.Request) (future DatabaseAccountsOfflineRegionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsonlineregion_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsonlineregion_autorest.go new file mode 100644 index 000000000000..33517cec529f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsonlineregion_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsOnlineRegionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsOnlineRegion ... +func (c CosmosDBClient) DatabaseAccountsOnlineRegion(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) (result DatabaseAccountsOnlineRegionOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsOnlineRegion(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsOnlineRegion", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsOnlineRegion(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsOnlineRegion", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsOnlineRegionThenPoll performs DatabaseAccountsOnlineRegion then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsOnlineRegionThenPoll(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) error { + result, err := c.DatabaseAccountsOnlineRegion(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsOnlineRegion: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsOnlineRegion: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsOnlineRegion prepares the DatabaseAccountsOnlineRegion request. +func (c CosmosDBClient) preparerForDatabaseAccountsOnlineRegion(ctx context.Context, id DatabaseAccountId, input RegionForOnlineOffline) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/onlineRegion", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsOnlineRegion sends the DatabaseAccountsOnlineRegion request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsOnlineRegion(ctx context.Context, req *http.Request) (future DatabaseAccountsOnlineRegionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsregeneratekey_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsregeneratekey_autorest.go new file mode 100644 index 000000000000..afc11e2ec8d2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsregeneratekey_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsRegenerateKeyOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsRegenerateKey ... +func (c CosmosDBClient) DatabaseAccountsRegenerateKey(ctx context.Context, id DatabaseAccountId, input DatabaseAccountRegenerateKeyParameters) (result DatabaseAccountsRegenerateKeyOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsRegenerateKey(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsRegenerateKey", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsRegenerateKey(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsRegenerateKey", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsRegenerateKeyThenPoll performs DatabaseAccountsRegenerateKey then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsRegenerateKeyThenPoll(ctx context.Context, id DatabaseAccountId, input DatabaseAccountRegenerateKeyParameters) error { + result, err := c.DatabaseAccountsRegenerateKey(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsRegenerateKey: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsRegenerateKey: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsRegenerateKey prepares the DatabaseAccountsRegenerateKey request. +func (c CosmosDBClient) preparerForDatabaseAccountsRegenerateKey(ctx context.Context, id DatabaseAccountId, input DatabaseAccountRegenerateKeyParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/regenerateKey", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsRegenerateKey sends the DatabaseAccountsRegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsRegenerateKey(ctx context.Context, req *http.Request) (future DatabaseAccountsRegenerateKeyOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsupdate_autorest.go new file mode 100644 index 000000000000..fcbf9e3c2c22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaseaccountsupdate_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DatabaseAccountsUpdate ... +func (c CosmosDBClient) DatabaseAccountsUpdate(ctx context.Context, id DatabaseAccountId, input DatabaseAccountUpdateParameters) (result DatabaseAccountsUpdateOperationResponse, err error) { + req, err := c.preparerForDatabaseAccountsUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForDatabaseAccountsUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseAccountsUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DatabaseAccountsUpdateThenPoll performs DatabaseAccountsUpdate then polls until it's completed +func (c CosmosDBClient) DatabaseAccountsUpdateThenPoll(ctx context.Context, id DatabaseAccountId, input DatabaseAccountUpdateParameters) error { + result, err := c.DatabaseAccountsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DatabaseAccountsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DatabaseAccountsUpdate: %+v", err) + } + + return nil +} + +// preparerForDatabaseAccountsUpdate prepares the DatabaseAccountsUpdate request. +func (c CosmosDBClient) preparerForDatabaseAccountsUpdate(ctx context.Context, id DatabaseAccountId, input DatabaseAccountUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDatabaseAccountsUpdate sends the DatabaseAccountsUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForDatabaseAccountsUpdate(ctx context.Context, req *http.Request) (future DatabaseAccountsUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetricdefinitions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetricdefinitions_autorest.go new file mode 100644 index 000000000000..bb4bbf1e1e47 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetricdefinitions_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseListMetricDefinitionsOperationResponse struct { + HttpResponse *http.Response + Model *MetricDefinitionsListResult +} + +// DatabaseListMetricDefinitions ... +func (c CosmosDBClient) DatabaseListMetricDefinitions(ctx context.Context, id DatabaseId) (result DatabaseListMetricDefinitionsOperationResponse, err error) { + req, err := c.preparerForDatabaseListMetricDefinitions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetricDefinitions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetricDefinitions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseListMetricDefinitions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetricDefinitions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseListMetricDefinitions prepares the DatabaseListMetricDefinitions request. +func (c CosmosDBClient) preparerForDatabaseListMetricDefinitions(ctx context.Context, id DatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/metricDefinitions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseListMetricDefinitions handles the response to the DatabaseListMetricDefinitions request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseListMetricDefinitions(resp *http.Response) (result DatabaseListMetricDefinitionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetrics_autorest.go new file mode 100644 index 000000000000..e8377f506135 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *MetricListResult +} + +type DatabaseListMetricsOperationOptions struct { + Filter *string +} + +func DefaultDatabaseListMetricsOperationOptions() DatabaseListMetricsOperationOptions { + return DatabaseListMetricsOperationOptions{} +} + +func (o DatabaseListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DatabaseListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// DatabaseListMetrics ... +func (c CosmosDBClient) DatabaseListMetrics(ctx context.Context, id DatabaseId, options DatabaseListMetricsOperationOptions) (result DatabaseListMetricsOperationResponse, err error) { + req, err := c.preparerForDatabaseListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseListMetrics prepares the DatabaseListMetrics request. +func (c CosmosDBClient) preparerForDatabaseListMetrics(ctx context.Context, id DatabaseId, options DatabaseListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseListMetrics handles the response to the DatabaseListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseListMetrics(resp *http.Response) (result DatabaseListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistusages_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistusages_autorest.go new file mode 100644 index 000000000000..43b8071eb444 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_databaselistusages_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseListUsagesOperationResponse struct { + HttpResponse *http.Response + Model *UsagesResult +} + +type DatabaseListUsagesOperationOptions struct { + Filter *string +} + +func DefaultDatabaseListUsagesOperationOptions() DatabaseListUsagesOperationOptions { + return DatabaseListUsagesOperationOptions{} +} + +func (o DatabaseListUsagesOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DatabaseListUsagesOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// DatabaseListUsages ... +func (c CosmosDBClient) DatabaseListUsages(ctx context.Context, id DatabaseId, options DatabaseListUsagesOperationOptions) (result DatabaseListUsagesOperationResponse, err error) { + req, err := c.preparerForDatabaseListUsages(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListUsages", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListUsages", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDatabaseListUsages(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "DatabaseListUsages", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDatabaseListUsages prepares the DatabaseListUsages request. +func (c CosmosDBClient) preparerForDatabaseListUsages(ctx context.Context, id DatabaseId, options DatabaseListUsagesOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/usages", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDatabaseListUsages handles the response to the DatabaseListUsages request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForDatabaseListUsages(resp *http.Response) (result DatabaseListUsagesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlindatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlindatabase_autorest.go new file mode 100644 index 000000000000..7b8944adeba6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlindatabase_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesCreateUpdateGremlinDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesCreateUpdateGremlinDatabase ... +func (c CosmosDBClient) GremlinResourcesCreateUpdateGremlinDatabase(ctx context.Context, id GremlinDatabaseId, input GremlinDatabaseCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinDatabaseOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesCreateUpdateGremlinDatabase(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesCreateUpdateGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesCreateUpdateGremlinDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesCreateUpdateGremlinDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesCreateUpdateGremlinDatabaseThenPoll performs GremlinResourcesCreateUpdateGremlinDatabase then polls until it's completed +func (c CosmosDBClient) GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx context.Context, id GremlinDatabaseId, input GremlinDatabaseCreateUpdateParameters) error { + result, err := c.GremlinResourcesCreateUpdateGremlinDatabase(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GremlinResourcesCreateUpdateGremlinDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesCreateUpdateGremlinDatabase: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesCreateUpdateGremlinDatabase prepares the GremlinResourcesCreateUpdateGremlinDatabase request. +func (c CosmosDBClient) preparerForGremlinResourcesCreateUpdateGremlinDatabase(ctx context.Context, id GremlinDatabaseId, input GremlinDatabaseCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesCreateUpdateGremlinDatabase sends the GremlinResourcesCreateUpdateGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesCreateUpdateGremlinDatabase(ctx context.Context, req *http.Request) (future GremlinResourcesCreateUpdateGremlinDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlingraph_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlingraph_autorest.go new file mode 100644 index 000000000000..26dcadac8d60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcescreateupdategremlingraph_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesCreateUpdateGremlinGraphOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesCreateUpdateGremlinGraph ... +func (c CosmosDBClient) GremlinResourcesCreateUpdateGremlinGraph(ctx context.Context, id GraphId, input GremlinGraphCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinGraphOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesCreateUpdateGremlinGraph(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesCreateUpdateGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesCreateUpdateGremlinGraph(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesCreateUpdateGremlinGraph", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesCreateUpdateGremlinGraphThenPoll performs GremlinResourcesCreateUpdateGremlinGraph then polls until it's completed +func (c CosmosDBClient) GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx context.Context, id GraphId, input GremlinGraphCreateUpdateParameters) error { + result, err := c.GremlinResourcesCreateUpdateGremlinGraph(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GremlinResourcesCreateUpdateGremlinGraph: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesCreateUpdateGremlinGraph: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesCreateUpdateGremlinGraph prepares the GremlinResourcesCreateUpdateGremlinGraph request. +func (c CosmosDBClient) preparerForGremlinResourcesCreateUpdateGremlinGraph(ctx context.Context, id GraphId, input GremlinGraphCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesCreateUpdateGremlinGraph sends the GremlinResourcesCreateUpdateGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesCreateUpdateGremlinGraph(ctx context.Context, req *http.Request) (future GremlinResourcesCreateUpdateGremlinGraphOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlindatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlindatabase_autorest.go new file mode 100644 index 000000000000..32b8692bc7e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlindatabase_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesDeleteGremlinDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesDeleteGremlinDatabase ... +func (c CosmosDBClient) GremlinResourcesDeleteGremlinDatabase(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesDeleteGremlinDatabaseOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesDeleteGremlinDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesDeleteGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesDeleteGremlinDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesDeleteGremlinDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesDeleteGremlinDatabaseThenPoll performs GremlinResourcesDeleteGremlinDatabase then polls until it's completed +func (c CosmosDBClient) GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx context.Context, id GremlinDatabaseId) error { + result, err := c.GremlinResourcesDeleteGremlinDatabase(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesDeleteGremlinDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesDeleteGremlinDatabase: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesDeleteGremlinDatabase prepares the GremlinResourcesDeleteGremlinDatabase request. +func (c CosmosDBClient) preparerForGremlinResourcesDeleteGremlinDatabase(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesDeleteGremlinDatabase sends the GremlinResourcesDeleteGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesDeleteGremlinDatabase(ctx context.Context, req *http.Request) (future GremlinResourcesDeleteGremlinDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlingraph_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlingraph_autorest.go new file mode 100644 index 000000000000..1997d958bd6b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesdeletegremlingraph_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesDeleteGremlinGraphOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesDeleteGremlinGraph ... +func (c CosmosDBClient) GremlinResourcesDeleteGremlinGraph(ctx context.Context, id GraphId) (result GremlinResourcesDeleteGremlinGraphOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesDeleteGremlinGraph(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesDeleteGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesDeleteGremlinGraph(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesDeleteGremlinGraph", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesDeleteGremlinGraphThenPoll performs GremlinResourcesDeleteGremlinGraph then polls until it's completed +func (c CosmosDBClient) GremlinResourcesDeleteGremlinGraphThenPoll(ctx context.Context, id GraphId) error { + result, err := c.GremlinResourcesDeleteGremlinGraph(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesDeleteGremlinGraph: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesDeleteGremlinGraph: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesDeleteGremlinGraph prepares the GremlinResourcesDeleteGremlinGraph request. +func (c CosmosDBClient) preparerForGremlinResourcesDeleteGremlinGraph(ctx context.Context, id GraphId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesDeleteGremlinGraph sends the GremlinResourcesDeleteGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesDeleteGremlinGraph(ctx context.Context, req *http.Request) (future GremlinResourcesDeleteGremlinGraphOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabase_autorest.go new file mode 100644 index 000000000000..466bd7270724 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabase_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesGetGremlinDatabaseOperationResponse struct { + HttpResponse *http.Response + Model *GremlinDatabaseGetResults +} + +// GremlinResourcesGetGremlinDatabase ... +func (c CosmosDBClient) GremlinResourcesGetGremlinDatabase(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesGetGremlinDatabaseOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesGetGremlinDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabase", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabase", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesGetGremlinDatabase(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabase", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesGetGremlinDatabase prepares the GremlinResourcesGetGremlinDatabase request. +func (c CosmosDBClient) preparerForGremlinResourcesGetGremlinDatabase(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesGetGremlinDatabase handles the response to the GremlinResourcesGetGremlinDatabase request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesGetGremlinDatabase(resp *http.Response) (result GremlinResourcesGetGremlinDatabaseOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabasethroughput_autorest.go new file mode 100644 index 000000000000..5959562fc5ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlindatabasethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesGetGremlinDatabaseThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// GremlinResourcesGetGremlinDatabaseThroughput ... +func (c CosmosDBClient) GremlinResourcesGetGremlinDatabaseThroughput(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesGetGremlinDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesGetGremlinDatabaseThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesGetGremlinDatabaseThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinDatabaseThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesGetGremlinDatabaseThroughput prepares the GremlinResourcesGetGremlinDatabaseThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesGetGremlinDatabaseThroughput(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesGetGremlinDatabaseThroughput handles the response to the GremlinResourcesGetGremlinDatabaseThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesGetGremlinDatabaseThroughput(resp *http.Response) (result GremlinResourcesGetGremlinDatabaseThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraph_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraph_autorest.go new file mode 100644 index 000000000000..362f804be6f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraph_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesGetGremlinGraphOperationResponse struct { + HttpResponse *http.Response + Model *GremlinGraphGetResults +} + +// GremlinResourcesGetGremlinGraph ... +func (c CosmosDBClient) GremlinResourcesGetGremlinGraph(ctx context.Context, id GraphId) (result GremlinResourcesGetGremlinGraphOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesGetGremlinGraph(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraph", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraph", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesGetGremlinGraph(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraph", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesGetGremlinGraph prepares the GremlinResourcesGetGremlinGraph request. +func (c CosmosDBClient) preparerForGremlinResourcesGetGremlinGraph(ctx context.Context, id GraphId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesGetGremlinGraph handles the response to the GremlinResourcesGetGremlinGraph request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesGetGremlinGraph(resp *http.Response) (result GremlinResourcesGetGremlinGraphOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraphthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraphthroughput_autorest.go new file mode 100644 index 000000000000..3d009d682209 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesgetgremlingraphthroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesGetGremlinGraphThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// GremlinResourcesGetGremlinGraphThroughput ... +func (c CosmosDBClient) GremlinResourcesGetGremlinGraphThroughput(ctx context.Context, id GraphId) (result GremlinResourcesGetGremlinGraphThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesGetGremlinGraphThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraphThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesGetGremlinGraphThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesGetGremlinGraphThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesGetGremlinGraphThroughput prepares the GremlinResourcesGetGremlinGraphThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesGetGremlinGraphThroughput(ctx context.Context, id GraphId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesGetGremlinGraphThroughput handles the response to the GremlinResourcesGetGremlinGraphThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesGetGremlinGraphThroughput(resp *http.Response) (result GremlinResourcesGetGremlinGraphThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlindatabases_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlindatabases_autorest.go new file mode 100644 index 000000000000..632d79b2b642 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlindatabases_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesListGremlinDatabasesOperationResponse struct { + HttpResponse *http.Response + Model *GremlinDatabaseListResult +} + +// GremlinResourcesListGremlinDatabases ... +func (c CosmosDBClient) GremlinResourcesListGremlinDatabases(ctx context.Context, id DatabaseAccountId) (result GremlinResourcesListGremlinDatabasesOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesListGremlinDatabases(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinDatabases", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinDatabases", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesListGremlinDatabases(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinDatabases", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesListGremlinDatabases prepares the GremlinResourcesListGremlinDatabases request. +func (c CosmosDBClient) preparerForGremlinResourcesListGremlinDatabases(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/gremlinDatabases", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesListGremlinDatabases handles the response to the GremlinResourcesListGremlinDatabases request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesListGremlinDatabases(resp *http.Response) (result GremlinResourcesListGremlinDatabasesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlingraphs_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlingraphs_autorest.go new file mode 100644 index 000000000000..5ce0f974155c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourceslistgremlingraphs_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesListGremlinGraphsOperationResponse struct { + HttpResponse *http.Response + Model *GremlinGraphListResult +} + +// GremlinResourcesListGremlinGraphs ... +func (c CosmosDBClient) GremlinResourcesListGremlinGraphs(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesListGremlinGraphsOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesListGremlinGraphs(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinGraphs", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinGraphs", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGremlinResourcesListGremlinGraphs(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesListGremlinGraphs", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGremlinResourcesListGremlinGraphs prepares the GremlinResourcesListGremlinGraphs request. +func (c CosmosDBClient) preparerForGremlinResourcesListGremlinGraphs(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/graphs", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGremlinResourcesListGremlinGraphs handles the response to the GremlinResourcesListGremlinGraphs request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForGremlinResourcesListGremlinGraphs(resp *http.Response) (result GremlinResourcesListGremlinGraphsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetoautoscale_autorest.go new file mode 100644 index 000000000000..58295459b732 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesMigrateGremlinDatabaseToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesMigrateGremlinDatabaseToAutoscale ... +func (c CosmosDBClient) GremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesMigrateGremlinDatabaseToAutoscaleOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinDatabaseToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll performs GremlinResourcesMigrateGremlinDatabaseToAutoscale then polls until it's completed +func (c CosmosDBClient) GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx context.Context, id GremlinDatabaseId) error { + result, err := c.GremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesMigrateGremlinDatabaseToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesMigrateGremlinDatabaseToAutoscale: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesMigrateGremlinDatabaseToAutoscale prepares the GremlinResourcesMigrateGremlinDatabaseToAutoscale request. +func (c CosmosDBClient) preparerForGremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesMigrateGremlinDatabaseToAutoscale sends the GremlinResourcesMigrateGremlinDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesMigrateGremlinDatabaseToAutoscale(ctx context.Context, req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetomanualthroughput_autorest.go new file mode 100644 index 000000000000..7ffd1b2cdac7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlindatabasetomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesMigrateGremlinDatabaseToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesMigrateGremlinDatabaseToManualThroughput ... +func (c CosmosDBClient) GremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx context.Context, id GremlinDatabaseId) (result GremlinResourcesMigrateGremlinDatabaseToManualThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinDatabaseToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll performs GremlinResourcesMigrateGremlinDatabaseToManualThroughput then polls until it's completed +func (c CosmosDBClient) GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx context.Context, id GremlinDatabaseId) error { + result, err := c.GremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesMigrateGremlinDatabaseToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesMigrateGremlinDatabaseToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesMigrateGremlinDatabaseToManualThroughput prepares the GremlinResourcesMigrateGremlinDatabaseToManualThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx context.Context, id GremlinDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesMigrateGremlinDatabaseToManualThroughput sends the GremlinResourcesMigrateGremlinDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesMigrateGremlinDatabaseToManualThroughput(ctx context.Context, req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtoautoscale_autorest.go new file mode 100644 index 000000000000..8d1a6641e277 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesMigrateGremlinGraphToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesMigrateGremlinGraphToAutoscale ... +func (c CosmosDBClient) GremlinResourcesMigrateGremlinGraphToAutoscale(ctx context.Context, id GraphId) (result GremlinResourcesMigrateGremlinGraphToAutoscaleOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesMigrateGremlinGraphToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinGraphToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesMigrateGremlinGraphToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinGraphToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll performs GremlinResourcesMigrateGremlinGraphToAutoscale then polls until it's completed +func (c CosmosDBClient) GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx context.Context, id GraphId) error { + result, err := c.GremlinResourcesMigrateGremlinGraphToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesMigrateGremlinGraphToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesMigrateGremlinGraphToAutoscale: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesMigrateGremlinGraphToAutoscale prepares the GremlinResourcesMigrateGremlinGraphToAutoscale request. +func (c CosmosDBClient) preparerForGremlinResourcesMigrateGremlinGraphToAutoscale(ctx context.Context, id GraphId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesMigrateGremlinGraphToAutoscale sends the GremlinResourcesMigrateGremlinGraphToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesMigrateGremlinGraphToAutoscale(ctx context.Context, req *http.Request) (future GremlinResourcesMigrateGremlinGraphToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtomanualthroughput_autorest.go new file mode 100644 index 000000000000..f79f4e62c5cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesmigrategremlingraphtomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesMigrateGremlinGraphToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesMigrateGremlinGraphToManualThroughput ... +func (c CosmosDBClient) GremlinResourcesMigrateGremlinGraphToManualThroughput(ctx context.Context, id GraphId) (result GremlinResourcesMigrateGremlinGraphToManualThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesMigrateGremlinGraphToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinGraphToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesMigrateGremlinGraphToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesMigrateGremlinGraphToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll performs GremlinResourcesMigrateGremlinGraphToManualThroughput then polls until it's completed +func (c CosmosDBClient) GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx context.Context, id GraphId) error { + result, err := c.GremlinResourcesMigrateGremlinGraphToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing GremlinResourcesMigrateGremlinGraphToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesMigrateGremlinGraphToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesMigrateGremlinGraphToManualThroughput prepares the GremlinResourcesMigrateGremlinGraphToManualThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesMigrateGremlinGraphToManualThroughput(ctx context.Context, id GraphId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesMigrateGremlinGraphToManualThroughput sends the GremlinResourcesMigrateGremlinGraphToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesMigrateGremlinGraphToManualThroughput(ctx context.Context, req *http.Request) (future GremlinResourcesMigrateGremlinGraphToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlindatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlindatabasethroughput_autorest.go new file mode 100644 index 000000000000..df906198e8cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlindatabasethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesUpdateGremlinDatabaseThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesUpdateGremlinDatabaseThroughput ... +func (c CosmosDBClient) GremlinResourcesUpdateGremlinDatabaseThroughput(ctx context.Context, id GremlinDatabaseId, input ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesUpdateGremlinDatabaseThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesUpdateGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesUpdateGremlinDatabaseThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesUpdateGremlinDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll performs GremlinResourcesUpdateGremlinDatabaseThroughput then polls until it's completed +func (c CosmosDBClient) GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx context.Context, id GremlinDatabaseId, input ThroughputSettingsUpdateParameters) error { + result, err := c.GremlinResourcesUpdateGremlinDatabaseThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GremlinResourcesUpdateGremlinDatabaseThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesUpdateGremlinDatabaseThroughput: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesUpdateGremlinDatabaseThroughput prepares the GremlinResourcesUpdateGremlinDatabaseThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesUpdateGremlinDatabaseThroughput(ctx context.Context, id GremlinDatabaseId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesUpdateGremlinDatabaseThroughput sends the GremlinResourcesUpdateGremlinDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesUpdateGremlinDatabaseThroughput(ctx context.Context, req *http.Request) (future GremlinResourcesUpdateGremlinDatabaseThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlingraphthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlingraphthroughput_autorest.go new file mode 100644 index 000000000000..b73a542c8cd3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_gremlinresourcesupdategremlingraphthroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinResourcesUpdateGremlinGraphThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// GremlinResourcesUpdateGremlinGraphThroughput ... +func (c CosmosDBClient) GremlinResourcesUpdateGremlinGraphThroughput(ctx context.Context, id GraphId, input ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinGraphThroughputOperationResponse, err error) { + req, err := c.preparerForGremlinResourcesUpdateGremlinGraphThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesUpdateGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForGremlinResourcesUpdateGremlinGraphThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "GremlinResourcesUpdateGremlinGraphThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// GremlinResourcesUpdateGremlinGraphThroughputThenPoll performs GremlinResourcesUpdateGremlinGraphThroughput then polls until it's completed +func (c CosmosDBClient) GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx context.Context, id GraphId, input ThroughputSettingsUpdateParameters) error { + result, err := c.GremlinResourcesUpdateGremlinGraphThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GremlinResourcesUpdateGremlinGraphThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after GremlinResourcesUpdateGremlinGraphThroughput: %+v", err) + } + + return nil +} + +// preparerForGremlinResourcesUpdateGremlinGraphThroughput prepares the GremlinResourcesUpdateGremlinGraphThroughput request. +func (c CosmosDBClient) preparerForGremlinResourcesUpdateGremlinGraphThroughput(ctx context.Context, id GraphId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForGremlinResourcesUpdateGremlinGraphThroughput sends the GremlinResourcesUpdateGremlinGraphThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForGremlinResourcesUpdateGremlinGraphThroughput(ctx context.Context, req *http.Request) (future GremlinResourcesUpdateGremlinGraphThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationsget_autorest.go new file mode 100644 index 000000000000..cff2c98e684f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationsget_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LocationsGetOperationResponse struct { + HttpResponse *http.Response + Model *LocationGetResult +} + +// LocationsGet ... +func (c CosmosDBClient) LocationsGet(ctx context.Context, id LocationId) (result LocationsGetOperationResponse, err error) { + req, err := c.preparerForLocationsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForLocationsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForLocationsGet prepares the LocationsGet request. +func (c CosmosDBClient) preparerForLocationsGet(ctx context.Context, id LocationId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForLocationsGet handles the response to the LocationsGet request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForLocationsGet(resp *http.Response) (result LocationsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationslist_autorest.go new file mode 100644 index 000000000000..4dde4b82b53a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_locationslist_autorest.go @@ -0,0 +1,70 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LocationsListOperationResponse struct { + HttpResponse *http.Response + Model *LocationListResult +} + +// LocationsList ... +func (c CosmosDBClient) LocationsList(ctx context.Context, id commonids.SubscriptionId) (result LocationsListOperationResponse, err error) { + req, err := c.preparerForLocationsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForLocationsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "LocationsList", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForLocationsList prepares the LocationsList request. +func (c CosmosDBClient) preparerForLocationsList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DocumentDB/locations", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForLocationsList handles the response to the LocationsList request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForLocationsList(resp *http.Response) (result LocationsListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbcollection_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbcollection_autorest.go new file mode 100644 index 000000000000..30e54826a73f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbcollection_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesCreateUpdateMongoDBCollectionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesCreateUpdateMongoDBCollection ... +func (c CosmosDBClient) MongoDBResourcesCreateUpdateMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId, input MongoDBCollectionCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBCollectionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesCreateUpdateMongoDBCollection(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesCreateUpdateMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesCreateUpdateMongoDBCollection(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesCreateUpdateMongoDBCollection", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll performs MongoDBResourcesCreateUpdateMongoDBCollection then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx context.Context, id MongodbDatabaseCollectionId, input MongoDBCollectionCreateUpdateParameters) error { + result, err := c.MongoDBResourcesCreateUpdateMongoDBCollection(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesCreateUpdateMongoDBCollection: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesCreateUpdateMongoDBCollection: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesCreateUpdateMongoDBCollection prepares the MongoDBResourcesCreateUpdateMongoDBCollection request. +func (c CosmosDBClient) preparerForMongoDBResourcesCreateUpdateMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId, input MongoDBCollectionCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesCreateUpdateMongoDBCollection sends the MongoDBResourcesCreateUpdateMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesCreateUpdateMongoDBCollection(ctx context.Context, req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBCollectionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbdatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbdatabase_autorest.go new file mode 100644 index 000000000000..339239710e84 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcescreateupdatemongodbdatabase_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesCreateUpdateMongoDBDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesCreateUpdateMongoDBDatabase ... +func (c CosmosDBClient) MongoDBResourcesCreateUpdateMongoDBDatabase(ctx context.Context, id MongodbDatabaseId, input MongoDBDatabaseCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBDatabaseOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesCreateUpdateMongoDBDatabase(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesCreateUpdateMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesCreateUpdateMongoDBDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesCreateUpdateMongoDBDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll performs MongoDBResourcesCreateUpdateMongoDBDatabase then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx context.Context, id MongodbDatabaseId, input MongoDBDatabaseCreateUpdateParameters) error { + result, err := c.MongoDBResourcesCreateUpdateMongoDBDatabase(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesCreateUpdateMongoDBDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesCreateUpdateMongoDBDatabase: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesCreateUpdateMongoDBDatabase prepares the MongoDBResourcesCreateUpdateMongoDBDatabase request. +func (c CosmosDBClient) preparerForMongoDBResourcesCreateUpdateMongoDBDatabase(ctx context.Context, id MongodbDatabaseId, input MongoDBDatabaseCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesCreateUpdateMongoDBDatabase sends the MongoDBResourcesCreateUpdateMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesCreateUpdateMongoDBDatabase(ctx context.Context, req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbcollection_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbcollection_autorest.go new file mode 100644 index 000000000000..9a502ef6a3bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbcollection_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesDeleteMongoDBCollectionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesDeleteMongoDBCollection ... +func (c CosmosDBClient) MongoDBResourcesDeleteMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId) (result MongoDBResourcesDeleteMongoDBCollectionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesDeleteMongoDBCollection(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesDeleteMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesDeleteMongoDBCollection(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesDeleteMongoDBCollection", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesDeleteMongoDBCollectionThenPoll performs MongoDBResourcesDeleteMongoDBCollection then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx context.Context, id MongodbDatabaseCollectionId) error { + result, err := c.MongoDBResourcesDeleteMongoDBCollection(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesDeleteMongoDBCollection: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesDeleteMongoDBCollection: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesDeleteMongoDBCollection prepares the MongoDBResourcesDeleteMongoDBCollection request. +func (c CosmosDBClient) preparerForMongoDBResourcesDeleteMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesDeleteMongoDBCollection sends the MongoDBResourcesDeleteMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesDeleteMongoDBCollection(ctx context.Context, req *http.Request) (future MongoDBResourcesDeleteMongoDBCollectionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbdatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbdatabase_autorest.go new file mode 100644 index 000000000000..c0107399d5d2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesdeletemongodbdatabase_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesDeleteMongoDBDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesDeleteMongoDBDatabase ... +func (c CosmosDBClient) MongoDBResourcesDeleteMongoDBDatabase(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesDeleteMongoDBDatabaseOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesDeleteMongoDBDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesDeleteMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesDeleteMongoDBDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesDeleteMongoDBDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesDeleteMongoDBDatabaseThenPoll performs MongoDBResourcesDeleteMongoDBDatabase then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx context.Context, id MongodbDatabaseId) error { + result, err := c.MongoDBResourcesDeleteMongoDBDatabase(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesDeleteMongoDBDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesDeleteMongoDBDatabase: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesDeleteMongoDBDatabase prepares the MongoDBResourcesDeleteMongoDBDatabase request. +func (c CosmosDBClient) preparerForMongoDBResourcesDeleteMongoDBDatabase(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesDeleteMongoDBDatabase sends the MongoDBResourcesDeleteMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesDeleteMongoDBDatabase(ctx context.Context, req *http.Request) (future MongoDBResourcesDeleteMongoDBDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollection_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollection_autorest.go new file mode 100644 index 000000000000..213eaa066c4c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollection_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoDBCollectionOperationResponse struct { + HttpResponse *http.Response + Model *MongoDBCollectionGetResults +} + +// MongoDBResourcesGetMongoDBCollection ... +func (c CosmosDBClient) MongoDBResourcesGetMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId) (result MongoDBResourcesGetMongoDBCollectionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoDBCollection(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollection", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollection", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoDBCollection(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollection", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoDBCollection prepares the MongoDBResourcesGetMongoDBCollection request. +func (c CosmosDBClient) preparerForMongoDBResourcesGetMongoDBCollection(ctx context.Context, id MongodbDatabaseCollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoDBCollection handles the response to the MongoDBResourcesGetMongoDBCollection request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesGetMongoDBCollection(resp *http.Response) (result MongoDBResourcesGetMongoDBCollectionOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollectionthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollectionthroughput_autorest.go new file mode 100644 index 000000000000..fa3bdfaa56ab --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbcollectionthroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoDBCollectionThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// MongoDBResourcesGetMongoDBCollectionThroughput ... +func (c CosmosDBClient) MongoDBResourcesGetMongoDBCollectionThroughput(ctx context.Context, id MongodbDatabaseCollectionId) (result MongoDBResourcesGetMongoDBCollectionThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollectionThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoDBCollectionThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBCollectionThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoDBCollectionThroughput prepares the MongoDBResourcesGetMongoDBCollectionThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesGetMongoDBCollectionThroughput(ctx context.Context, id MongodbDatabaseCollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoDBCollectionThroughput handles the response to the MongoDBResourcesGetMongoDBCollectionThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesGetMongoDBCollectionThroughput(resp *http.Response) (result MongoDBResourcesGetMongoDBCollectionThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabase_autorest.go new file mode 100644 index 000000000000..9ce6bae2968f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabase_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoDBDatabaseOperationResponse struct { + HttpResponse *http.Response + Model *MongoDBDatabaseGetResults +} + +// MongoDBResourcesGetMongoDBDatabase ... +func (c CosmosDBClient) MongoDBResourcesGetMongoDBDatabase(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesGetMongoDBDatabaseOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoDBDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabase", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabase", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoDBDatabase(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabase", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoDBDatabase prepares the MongoDBResourcesGetMongoDBDatabase request. +func (c CosmosDBClient) preparerForMongoDBResourcesGetMongoDBDatabase(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoDBDatabase handles the response to the MongoDBResourcesGetMongoDBDatabase request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesGetMongoDBDatabase(resp *http.Response) (result MongoDBResourcesGetMongoDBDatabaseOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabasethroughput_autorest.go new file mode 100644 index 000000000000..eaadc800a7c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesgetmongodbdatabasethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoDBDatabaseThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// MongoDBResourcesGetMongoDBDatabaseThroughput ... +func (c CosmosDBClient) MongoDBResourcesGetMongoDBDatabaseThroughput(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesGetMongoDBDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoDBDatabaseThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesGetMongoDBDatabaseThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoDBDatabaseThroughput prepares the MongoDBResourcesGetMongoDBDatabaseThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesGetMongoDBDatabaseThroughput(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoDBDatabaseThroughput handles the response to the MongoDBResourcesGetMongoDBDatabaseThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesGetMongoDBDatabaseThroughput(resp *http.Response) (result MongoDBResourcesGetMongoDBDatabaseThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbcollections_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbcollections_autorest.go new file mode 100644 index 000000000000..c9e8e105991a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbcollections_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesListMongoDBCollectionsOperationResponse struct { + HttpResponse *http.Response + Model *MongoDBCollectionListResult +} + +// MongoDBResourcesListMongoDBCollections ... +func (c CosmosDBClient) MongoDBResourcesListMongoDBCollections(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesListMongoDBCollectionsOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesListMongoDBCollections(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBCollections", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBCollections", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesListMongoDBCollections(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBCollections", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesListMongoDBCollections prepares the MongoDBResourcesListMongoDBCollections request. +func (c CosmosDBClient) preparerForMongoDBResourcesListMongoDBCollections(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/collections", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesListMongoDBCollections handles the response to the MongoDBResourcesListMongoDBCollections request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesListMongoDBCollections(resp *http.Response) (result MongoDBResourcesListMongoDBCollectionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbdatabases_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbdatabases_autorest.go new file mode 100644 index 000000000000..ac29c72a89c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourceslistmongodbdatabases_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesListMongoDBDatabasesOperationResponse struct { + HttpResponse *http.Response + Model *MongoDBDatabaseListResult +} + +// MongoDBResourcesListMongoDBDatabases ... +func (c CosmosDBClient) MongoDBResourcesListMongoDBDatabases(ctx context.Context, id DatabaseAccountId) (result MongoDBResourcesListMongoDBDatabasesOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesListMongoDBDatabases(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBDatabases", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBDatabases", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesListMongoDBDatabases(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesListMongoDBDatabases", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesListMongoDBDatabases prepares the MongoDBResourcesListMongoDBDatabases request. +func (c CosmosDBClient) preparerForMongoDBResourcesListMongoDBDatabases(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/mongodbDatabases", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesListMongoDBDatabases handles the response to the MongoDBResourcesListMongoDBDatabases request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForMongoDBResourcesListMongoDBDatabases(resp *http.Response) (result MongoDBResourcesListMongoDBDatabasesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontoautoscale_autorest.go new file mode 100644 index 000000000000..ff27746f494c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesMigrateMongoDBCollectionToAutoscale ... +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx context.Context, id MongodbDatabaseCollectionId) (result MongoDBResourcesMigrateMongoDBCollectionToAutoscaleOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBCollectionToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBCollectionToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll performs MongoDBResourcesMigrateMongoDBCollectionToAutoscale then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx context.Context, id MongodbDatabaseCollectionId) error { + result, err := c.MongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesMigrateMongoDBCollectionToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesMigrateMongoDBCollectionToAutoscale: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesMigrateMongoDBCollectionToAutoscale prepares the MongoDBResourcesMigrateMongoDBCollectionToAutoscale request. +func (c CosmosDBClient) preparerForMongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx context.Context, id MongodbDatabaseCollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesMigrateMongoDBCollectionToAutoscale sends the MongoDBResourcesMigrateMongoDBCollectionToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesMigrateMongoDBCollectionToAutoscale(ctx context.Context, req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontomanualthroughput_autorest.go new file mode 100644 index 000000000000..7ca2a5a1eba6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbcollectiontomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesMigrateMongoDBCollectionToManualThroughput ... +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx context.Context, id MongodbDatabaseCollectionId) (result MongoDBResourcesMigrateMongoDBCollectionToManualThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBCollectionToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBCollectionToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll performs MongoDBResourcesMigrateMongoDBCollectionToManualThroughput then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx context.Context, id MongodbDatabaseCollectionId) error { + result, err := c.MongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesMigrateMongoDBCollectionToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesMigrateMongoDBCollectionToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput prepares the MongoDBResourcesMigrateMongoDBCollectionToManualThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx context.Context, id MongodbDatabaseCollectionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput sends the MongoDBResourcesMigrateMongoDBCollectionToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesMigrateMongoDBCollectionToManualThroughput(ctx context.Context, req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetoautoscale_autorest.go new file mode 100644 index 000000000000..bf87e44f0558 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesMigrateMongoDBDatabaseToAutoscale ... +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBDatabaseToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll performs MongoDBResourcesMigrateMongoDBDatabaseToAutoscale then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx context.Context, id MongodbDatabaseId) error { + result, err := c.MongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesMigrateMongoDBDatabaseToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesMigrateMongoDBDatabaseToAutoscale: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale prepares the MongoDBResourcesMigrateMongoDBDatabaseToAutoscale request. +func (c CosmosDBClient) preparerForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale sends the MongoDBResourcesMigrateMongoDBDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesMigrateMongoDBDatabaseToAutoscale(ctx context.Context, req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetomanualthroughput_autorest.go new file mode 100644 index 000000000000..ce0d8aa43bcd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesmigratemongodbdatabasetomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput ... +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx context.Context, id MongodbDatabaseId) (result MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll performs MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx context.Context, id MongodbDatabaseId) error { + result, err := c.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput prepares the MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx context.Context, id MongodbDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput sends the MongoDBResourcesMigrateMongoDBDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesMigrateMongoDBDatabaseToManualThroughput(ctx context.Context, req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbcollectionthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbcollectionthroughput_autorest.go new file mode 100644 index 000000000000..b35713b3706a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbcollectionthroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesUpdateMongoDBCollectionThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesUpdateMongoDBCollectionThroughput ... +func (c CosmosDBClient) MongoDBResourcesUpdateMongoDBCollectionThroughput(ctx context.Context, id MongodbDatabaseCollectionId, input ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBCollectionThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesUpdateMongoDBCollectionThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesUpdateMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesUpdateMongoDBCollectionThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesUpdateMongoDBCollectionThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll performs MongoDBResourcesUpdateMongoDBCollectionThroughput then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx context.Context, id MongodbDatabaseCollectionId, input ThroughputSettingsUpdateParameters) error { + result, err := c.MongoDBResourcesUpdateMongoDBCollectionThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesUpdateMongoDBCollectionThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesUpdateMongoDBCollectionThroughput: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesUpdateMongoDBCollectionThroughput prepares the MongoDBResourcesUpdateMongoDBCollectionThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesUpdateMongoDBCollectionThroughput(ctx context.Context, id MongodbDatabaseCollectionId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesUpdateMongoDBCollectionThroughput sends the MongoDBResourcesUpdateMongoDBCollectionThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesUpdateMongoDBCollectionThroughput(ctx context.Context, req *http.Request) (future MongoDBResourcesUpdateMongoDBCollectionThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbdatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbdatabasethroughput_autorest.go new file mode 100644 index 000000000000..72e949c7bd9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_mongodbresourcesupdatemongodbdatabasethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesUpdateMongoDBDatabaseThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesUpdateMongoDBDatabaseThroughput ... +func (c CosmosDBClient) MongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx context.Context, id MongodbDatabaseId, input ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesUpdateMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "MongoDBResourcesUpdateMongoDBDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll performs MongoDBResourcesUpdateMongoDBDatabaseThroughput then polls until it's completed +func (c CosmosDBClient) MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx context.Context, id MongodbDatabaseId, input ThroughputSettingsUpdateParameters) error { + result, err := c.MongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesUpdateMongoDBDatabaseThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesUpdateMongoDBDatabaseThroughput: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesUpdateMongoDBDatabaseThroughput prepares the MongoDBResourcesUpdateMongoDBDatabaseThroughput request. +func (c CosmosDBClient) preparerForMongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx context.Context, id MongodbDatabaseId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesUpdateMongoDBDatabaseThroughput sends the MongoDBResourcesUpdateMongoDBDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForMongoDBResourcesUpdateMongoDBDatabaseThroughput(ctx context.Context, req *http.Request) (future MongoDBResourcesUpdateMongoDBDatabaseThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidlistmetrics_autorest.go new file mode 100644 index 000000000000..c6eb42d676a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionKeyRangeIdListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PartitionMetricListResult +} + +type PartitionKeyRangeIdListMetricsOperationOptions struct { + Filter *string +} + +func DefaultPartitionKeyRangeIdListMetricsOperationOptions() PartitionKeyRangeIdListMetricsOperationOptions { + return PartitionKeyRangeIdListMetricsOperationOptions{} +} + +func (o PartitionKeyRangeIdListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PartitionKeyRangeIdListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// PartitionKeyRangeIdListMetrics ... +func (c CosmosDBClient) PartitionKeyRangeIdListMetrics(ctx context.Context, id PartitionKeyRangeIdId, options PartitionKeyRangeIdListMetricsOperationOptions) (result PartitionKeyRangeIdListMetricsOperationResponse, err error) { + req, err := c.preparerForPartitionKeyRangeIdListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPartitionKeyRangeIdListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPartitionKeyRangeIdListMetrics prepares the PartitionKeyRangeIdListMetrics request. +func (c CosmosDBClient) preparerForPartitionKeyRangeIdListMetrics(ctx context.Context, id PartitionKeyRangeIdId, options PartitionKeyRangeIdListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPartitionKeyRangeIdListMetrics handles the response to the PartitionKeyRangeIdListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForPartitionKeyRangeIdListMetrics(resp *http.Response) (result PartitionKeyRangeIdListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidregionlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidregionlistmetrics_autorest.go new file mode 100644 index 000000000000..12c69fcb9a96 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_partitionkeyrangeidregionlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionKeyRangeIdRegionListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PartitionMetricListResult +} + +type PartitionKeyRangeIdRegionListMetricsOperationOptions struct { + Filter *string +} + +func DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions() PartitionKeyRangeIdRegionListMetricsOperationOptions { + return PartitionKeyRangeIdRegionListMetricsOperationOptions{} +} + +func (o PartitionKeyRangeIdRegionListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PartitionKeyRangeIdRegionListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// PartitionKeyRangeIdRegionListMetrics ... +func (c CosmosDBClient) PartitionKeyRangeIdRegionListMetrics(ctx context.Context, id CollectionPartitionKeyRangeIdId, options PartitionKeyRangeIdRegionListMetricsOperationOptions) (result PartitionKeyRangeIdRegionListMetricsOperationResponse, err error) { + req, err := c.preparerForPartitionKeyRangeIdRegionListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdRegionListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdRegionListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPartitionKeyRangeIdRegionListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PartitionKeyRangeIdRegionListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPartitionKeyRangeIdRegionListMetrics prepares the PartitionKeyRangeIdRegionListMetrics request. +func (c CosmosDBClient) preparerForPartitionKeyRangeIdRegionListMetrics(ctx context.Context, id CollectionPartitionKeyRangeIdId, options PartitionKeyRangeIdRegionListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPartitionKeyRangeIdRegionListMetrics handles the response to the PartitionKeyRangeIdRegionListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForPartitionKeyRangeIdRegionListMetrics(resp *http.Response) (result PartitionKeyRangeIdRegionListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilelistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilelistmetrics_autorest.go new file mode 100644 index 000000000000..60480b11730c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilelistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PercentileMetricListResult +} + +type PercentileListMetricsOperationOptions struct { + Filter *string +} + +func DefaultPercentileListMetricsOperationOptions() PercentileListMetricsOperationOptions { + return PercentileListMetricsOperationOptions{} +} + +func (o PercentileListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PercentileListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// PercentileListMetrics ... +func (c CosmosDBClient) PercentileListMetrics(ctx context.Context, id DatabaseAccountId, options PercentileListMetricsOperationOptions) (result PercentileListMetricsOperationResponse, err error) { + req, err := c.preparerForPercentileListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPercentileListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPercentileListMetrics prepares the PercentileListMetrics request. +func (c CosmosDBClient) preparerForPercentileListMetrics(ctx context.Context, id DatabaseAccountId, options PercentileListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/percentile/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPercentileListMetrics handles the response to the PercentileListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForPercentileListMetrics(resp *http.Response) (result PercentileListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilesourcetargetlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilesourcetargetlistmetrics_autorest.go new file mode 100644 index 000000000000..12b83290ff6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentilesourcetargetlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileSourceTargetListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PercentileMetricListResult +} + +type PercentileSourceTargetListMetricsOperationOptions struct { + Filter *string +} + +func DefaultPercentileSourceTargetListMetricsOperationOptions() PercentileSourceTargetListMetricsOperationOptions { + return PercentileSourceTargetListMetricsOperationOptions{} +} + +func (o PercentileSourceTargetListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PercentileSourceTargetListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// PercentileSourceTargetListMetrics ... +func (c CosmosDBClient) PercentileSourceTargetListMetrics(ctx context.Context, id SourceRegionTargetRegionId, options PercentileSourceTargetListMetricsOperationOptions) (result PercentileSourceTargetListMetricsOperationResponse, err error) { + req, err := c.preparerForPercentileSourceTargetListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileSourceTargetListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileSourceTargetListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPercentileSourceTargetListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileSourceTargetListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPercentileSourceTargetListMetrics prepares the PercentileSourceTargetListMetrics request. +func (c CosmosDBClient) preparerForPercentileSourceTargetListMetrics(ctx context.Context, id SourceRegionTargetRegionId, options PercentileSourceTargetListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/percentile/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPercentileSourceTargetListMetrics handles the response to the PercentileSourceTargetListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForPercentileSourceTargetListMetrics(resp *http.Response) (result PercentileSourceTargetListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentiletargetlistmetrics_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentiletargetlistmetrics_autorest.go new file mode 100644 index 000000000000..91c408bd9c8a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_percentiletargetlistmetrics_autorest.go @@ -0,0 +1,98 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileTargetListMetricsOperationResponse struct { + HttpResponse *http.Response + Model *PercentileMetricListResult +} + +type PercentileTargetListMetricsOperationOptions struct { + Filter *string +} + +func DefaultPercentileTargetListMetricsOperationOptions() PercentileTargetListMetricsOperationOptions { + return PercentileTargetListMetricsOperationOptions{} +} + +func (o PercentileTargetListMetricsOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PercentileTargetListMetricsOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// PercentileTargetListMetrics ... +func (c CosmosDBClient) PercentileTargetListMetrics(ctx context.Context, id TargetRegionId, options PercentileTargetListMetricsOperationOptions) (result PercentileTargetListMetricsOperationResponse, err error) { + req, err := c.preparerForPercentileTargetListMetrics(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileTargetListMetrics", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileTargetListMetrics", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPercentileTargetListMetrics(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "PercentileTargetListMetrics", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPercentileTargetListMetrics prepares the PercentileTargetListMetrics request. +func (c CosmosDBClient) preparerForPercentileTargetListMetrics(ctx context.Context, id TargetRegionId, options PercentileTargetListMetricsOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/percentile/metrics", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPercentileTargetListMetrics handles the response to the PercentileTargetListMetrics request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForPercentileTargetListMetrics(resp *http.Response) (result PercentileTargetListMetricsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdateclientencryptionkey_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdateclientencryptionkey_autorest.go new file mode 100644 index 000000000000..308b24d29a33 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdateclientencryptionkey_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateClientEncryptionKeyOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateClientEncryptionKey ... +func (c CosmosDBClient) SqlResourcesCreateUpdateClientEncryptionKey(ctx context.Context, id ClientEncryptionKeyId, input ClientEncryptionKeyCreateUpdateParameters) (result SqlResourcesCreateUpdateClientEncryptionKeyOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateClientEncryptionKey(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateClientEncryptionKey", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateClientEncryptionKey(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateClientEncryptionKey", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateClientEncryptionKeyThenPoll performs SqlResourcesCreateUpdateClientEncryptionKey then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx context.Context, id ClientEncryptionKeyId, input ClientEncryptionKeyCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateClientEncryptionKey(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateClientEncryptionKey: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateClientEncryptionKey: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateClientEncryptionKey prepares the SqlResourcesCreateUpdateClientEncryptionKey request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateClientEncryptionKey(ctx context.Context, id ClientEncryptionKeyId, input ClientEncryptionKeyCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateClientEncryptionKey sends the SqlResourcesCreateUpdateClientEncryptionKey request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateClientEncryptionKey(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateClientEncryptionKeyOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlcontainer_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlcontainer_autorest.go new file mode 100644 index 000000000000..da0db6c64f3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlcontainer_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateSqlContainerOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateSqlContainer ... +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlContainer(ctx context.Context, id ContainerId, input SqlContainerCreateUpdateParameters) (result SqlResourcesCreateUpdateSqlContainerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateSqlContainer(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlContainer", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateSqlContainer(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlContainer", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateSqlContainerThenPoll performs SqlResourcesCreateUpdateSqlContainer then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlContainerThenPoll(ctx context.Context, id ContainerId, input SqlContainerCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateSqlContainer(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateSqlContainer: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateSqlContainer: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateSqlContainer prepares the SqlResourcesCreateUpdateSqlContainer request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateSqlContainer(ctx context.Context, id ContainerId, input SqlContainerCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateSqlContainer sends the SqlResourcesCreateUpdateSqlContainer request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateSqlContainer(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateSqlContainerOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqldatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqldatabase_autorest.go new file mode 100644 index 000000000000..7cd0570374e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqldatabase_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateSqlDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateSqlDatabase ... +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlDatabase(ctx context.Context, id SqlDatabaseId, input SqlDatabaseCreateUpdateParameters) (result SqlResourcesCreateUpdateSqlDatabaseOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateSqlDatabase(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateSqlDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateSqlDatabaseThenPoll performs SqlResourcesCreateUpdateSqlDatabase then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx context.Context, id SqlDatabaseId, input SqlDatabaseCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateSqlDatabase(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateSqlDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateSqlDatabase: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateSqlDatabase prepares the SqlResourcesCreateUpdateSqlDatabase request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateSqlDatabase(ctx context.Context, id SqlDatabaseId, input SqlDatabaseCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateSqlDatabase sends the SqlResourcesCreateUpdateSqlDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateSqlDatabase(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateSqlDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlstoredprocedure_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlstoredprocedure_autorest.go new file mode 100644 index 000000000000..ae3c28788107 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqlstoredprocedure_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateSqlStoredProcedureOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateSqlStoredProcedure ... +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlStoredProcedure(ctx context.Context, id StoredProcedureId, input SqlStoredProcedureCreateUpdateParameters) (result SqlResourcesCreateUpdateSqlStoredProcedureOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateSqlStoredProcedure(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateSqlStoredProcedure(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlStoredProcedure", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateSqlStoredProcedureThenPoll performs SqlResourcesCreateUpdateSqlStoredProcedure then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx context.Context, id StoredProcedureId, input SqlStoredProcedureCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateSqlStoredProcedure(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateSqlStoredProcedure: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateSqlStoredProcedure: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateSqlStoredProcedure prepares the SqlResourcesCreateUpdateSqlStoredProcedure request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateSqlStoredProcedure(ctx context.Context, id StoredProcedureId, input SqlStoredProcedureCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateSqlStoredProcedure sends the SqlResourcesCreateUpdateSqlStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateSqlStoredProcedure(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateSqlStoredProcedureOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqltrigger_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqltrigger_autorest.go new file mode 100644 index 000000000000..4a1158439d99 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqltrigger_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateSqlTriggerOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateSqlTrigger ... +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlTrigger(ctx context.Context, id TriggerId, input SqlTriggerCreateUpdateParameters) (result SqlResourcesCreateUpdateSqlTriggerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateSqlTrigger(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlTrigger", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateSqlTrigger(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlTrigger", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateSqlTriggerThenPoll performs SqlResourcesCreateUpdateSqlTrigger then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx context.Context, id TriggerId, input SqlTriggerCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateSqlTrigger(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateSqlTrigger: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateSqlTrigger: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateSqlTrigger prepares the SqlResourcesCreateUpdateSqlTrigger request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateSqlTrigger(ctx context.Context, id TriggerId, input SqlTriggerCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateSqlTrigger sends the SqlResourcesCreateUpdateSqlTrigger request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateSqlTrigger(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateSqlTriggerOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqluserdefinedfunction_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqluserdefinedfunction_autorest.go new file mode 100644 index 000000000000..9da784b92489 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcescreateupdatesqluserdefinedfunction_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesCreateUpdateSqlUserDefinedFunctionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesCreateUpdateSqlUserDefinedFunction ... +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId, input SqlUserDefinedFunctionCreateUpdateParameters) (result SqlResourcesCreateUpdateSqlUserDefinedFunctionOperationResponse, err error) { + req, err := c.preparerForSqlResourcesCreateUpdateSqlUserDefinedFunction(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesCreateUpdateSqlUserDefinedFunction(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesCreateUpdateSqlUserDefinedFunction", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll performs SqlResourcesCreateUpdateSqlUserDefinedFunction then polls until it's completed +func (c CosmosDBClient) SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx context.Context, id UserDefinedFunctionId, input SqlUserDefinedFunctionCreateUpdateParameters) error { + result, err := c.SqlResourcesCreateUpdateSqlUserDefinedFunction(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesCreateUpdateSqlUserDefinedFunction: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesCreateUpdateSqlUserDefinedFunction: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesCreateUpdateSqlUserDefinedFunction prepares the SqlResourcesCreateUpdateSqlUserDefinedFunction request. +func (c CosmosDBClient) preparerForSqlResourcesCreateUpdateSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId, input SqlUserDefinedFunctionCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesCreateUpdateSqlUserDefinedFunction sends the SqlResourcesCreateUpdateSqlUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesCreateUpdateSqlUserDefinedFunction(ctx context.Context, req *http.Request) (future SqlResourcesCreateUpdateSqlUserDefinedFunctionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlcontainer_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlcontainer_autorest.go new file mode 100644 index 000000000000..a63b62e30d0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlcontainer_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesDeleteSqlContainerOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesDeleteSqlContainer ... +func (c CosmosDBClient) SqlResourcesDeleteSqlContainer(ctx context.Context, id ContainerId) (result SqlResourcesDeleteSqlContainerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesDeleteSqlContainer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlContainer", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesDeleteSqlContainer(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlContainer", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesDeleteSqlContainerThenPoll performs SqlResourcesDeleteSqlContainer then polls until it's completed +func (c CosmosDBClient) SqlResourcesDeleteSqlContainerThenPoll(ctx context.Context, id ContainerId) error { + result, err := c.SqlResourcesDeleteSqlContainer(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesDeleteSqlContainer: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesDeleteSqlContainer: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesDeleteSqlContainer prepares the SqlResourcesDeleteSqlContainer request. +func (c CosmosDBClient) preparerForSqlResourcesDeleteSqlContainer(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesDeleteSqlContainer sends the SqlResourcesDeleteSqlContainer request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesDeleteSqlContainer(ctx context.Context, req *http.Request) (future SqlResourcesDeleteSqlContainerOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqldatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqldatabase_autorest.go new file mode 100644 index 000000000000..e39611a2815e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqldatabase_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesDeleteSqlDatabaseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesDeleteSqlDatabase ... +func (c CosmosDBClient) SqlResourcesDeleteSqlDatabase(ctx context.Context, id SqlDatabaseId) (result SqlResourcesDeleteSqlDatabaseOperationResponse, err error) { + req, err := c.preparerForSqlResourcesDeleteSqlDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlDatabase", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesDeleteSqlDatabase(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlDatabase", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesDeleteSqlDatabaseThenPoll performs SqlResourcesDeleteSqlDatabase then polls until it's completed +func (c CosmosDBClient) SqlResourcesDeleteSqlDatabaseThenPoll(ctx context.Context, id SqlDatabaseId) error { + result, err := c.SqlResourcesDeleteSqlDatabase(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesDeleteSqlDatabase: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesDeleteSqlDatabase: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesDeleteSqlDatabase prepares the SqlResourcesDeleteSqlDatabase request. +func (c CosmosDBClient) preparerForSqlResourcesDeleteSqlDatabase(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesDeleteSqlDatabase sends the SqlResourcesDeleteSqlDatabase request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesDeleteSqlDatabase(ctx context.Context, req *http.Request) (future SqlResourcesDeleteSqlDatabaseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlstoredprocedure_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlstoredprocedure_autorest.go new file mode 100644 index 000000000000..43cca9533f98 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqlstoredprocedure_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesDeleteSqlStoredProcedureOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesDeleteSqlStoredProcedure ... +func (c CosmosDBClient) SqlResourcesDeleteSqlStoredProcedure(ctx context.Context, id StoredProcedureId) (result SqlResourcesDeleteSqlStoredProcedureOperationResponse, err error) { + req, err := c.preparerForSqlResourcesDeleteSqlStoredProcedure(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesDeleteSqlStoredProcedure(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlStoredProcedure", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesDeleteSqlStoredProcedureThenPoll performs SqlResourcesDeleteSqlStoredProcedure then polls until it's completed +func (c CosmosDBClient) SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx context.Context, id StoredProcedureId) error { + result, err := c.SqlResourcesDeleteSqlStoredProcedure(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesDeleteSqlStoredProcedure: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesDeleteSqlStoredProcedure: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesDeleteSqlStoredProcedure prepares the SqlResourcesDeleteSqlStoredProcedure request. +func (c CosmosDBClient) preparerForSqlResourcesDeleteSqlStoredProcedure(ctx context.Context, id StoredProcedureId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesDeleteSqlStoredProcedure sends the SqlResourcesDeleteSqlStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesDeleteSqlStoredProcedure(ctx context.Context, req *http.Request) (future SqlResourcesDeleteSqlStoredProcedureOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqltrigger_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqltrigger_autorest.go new file mode 100644 index 000000000000..c85edcfc81e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqltrigger_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesDeleteSqlTriggerOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesDeleteSqlTrigger ... +func (c CosmosDBClient) SqlResourcesDeleteSqlTrigger(ctx context.Context, id TriggerId) (result SqlResourcesDeleteSqlTriggerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesDeleteSqlTrigger(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlTrigger", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesDeleteSqlTrigger(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlTrigger", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesDeleteSqlTriggerThenPoll performs SqlResourcesDeleteSqlTrigger then polls until it's completed +func (c CosmosDBClient) SqlResourcesDeleteSqlTriggerThenPoll(ctx context.Context, id TriggerId) error { + result, err := c.SqlResourcesDeleteSqlTrigger(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesDeleteSqlTrigger: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesDeleteSqlTrigger: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesDeleteSqlTrigger prepares the SqlResourcesDeleteSqlTrigger request. +func (c CosmosDBClient) preparerForSqlResourcesDeleteSqlTrigger(ctx context.Context, id TriggerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesDeleteSqlTrigger sends the SqlResourcesDeleteSqlTrigger request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesDeleteSqlTrigger(ctx context.Context, req *http.Request) (future SqlResourcesDeleteSqlTriggerOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqluserdefinedfunction_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqluserdefinedfunction_autorest.go new file mode 100644 index 000000000000..c6b583abde7c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesdeletesqluserdefinedfunction_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesDeleteSqlUserDefinedFunctionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesDeleteSqlUserDefinedFunction ... +func (c CosmosDBClient) SqlResourcesDeleteSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId) (result SqlResourcesDeleteSqlUserDefinedFunctionOperationResponse, err error) { + req, err := c.preparerForSqlResourcesDeleteSqlUserDefinedFunction(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesDeleteSqlUserDefinedFunction(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesDeleteSqlUserDefinedFunction", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesDeleteSqlUserDefinedFunctionThenPoll performs SqlResourcesDeleteSqlUserDefinedFunction then polls until it's completed +func (c CosmosDBClient) SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx context.Context, id UserDefinedFunctionId) error { + result, err := c.SqlResourcesDeleteSqlUserDefinedFunction(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesDeleteSqlUserDefinedFunction: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesDeleteSqlUserDefinedFunction: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesDeleteSqlUserDefinedFunction prepares the SqlResourcesDeleteSqlUserDefinedFunction request. +func (c CosmosDBClient) preparerForSqlResourcesDeleteSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesDeleteSqlUserDefinedFunction sends the SqlResourcesDeleteSqlUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesDeleteSqlUserDefinedFunction(ctx context.Context, req *http.Request) (future SqlResourcesDeleteSqlUserDefinedFunctionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetclientencryptionkey_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetclientencryptionkey_autorest.go new file mode 100644 index 000000000000..ab6dc9e9d12b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetclientencryptionkey_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetClientEncryptionKeyOperationResponse struct { + HttpResponse *http.Response + Model *ClientEncryptionKeyGetResults +} + +// SqlResourcesGetClientEncryptionKey ... +func (c CosmosDBClient) SqlResourcesGetClientEncryptionKey(ctx context.Context, id ClientEncryptionKeyId) (result SqlResourcesGetClientEncryptionKeyOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetClientEncryptionKey(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetClientEncryptionKey", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetClientEncryptionKey", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetClientEncryptionKey(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetClientEncryptionKey", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetClientEncryptionKey prepares the SqlResourcesGetClientEncryptionKey request. +func (c CosmosDBClient) preparerForSqlResourcesGetClientEncryptionKey(ctx context.Context, id ClientEncryptionKeyId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetClientEncryptionKey handles the response to the SqlResourcesGetClientEncryptionKey request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetClientEncryptionKey(resp *http.Response) (result SqlResourcesGetClientEncryptionKeyOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainer_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainer_autorest.go new file mode 100644 index 000000000000..bb5dc5d43b82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainer_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlContainerOperationResponse struct { + HttpResponse *http.Response + Model *SqlContainerGetResults +} + +// SqlResourcesGetSqlContainer ... +func (c CosmosDBClient) SqlResourcesGetSqlContainer(ctx context.Context, id ContainerId) (result SqlResourcesGetSqlContainerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlContainer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainer", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainer", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlContainer(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainer", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlContainer prepares the SqlResourcesGetSqlContainer request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlContainer(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlContainer handles the response to the SqlResourcesGetSqlContainer request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlContainer(resp *http.Response) (result SqlResourcesGetSqlContainerOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainerthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainerthroughput_autorest.go new file mode 100644 index 000000000000..6fa8a29d3b8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlcontainerthroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlContainerThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// SqlResourcesGetSqlContainerThroughput ... +func (c CosmosDBClient) SqlResourcesGetSqlContainerThroughput(ctx context.Context, id ContainerId) (result SqlResourcesGetSqlContainerThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlContainerThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainerThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainerThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlContainerThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlContainerThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlContainerThroughput prepares the SqlResourcesGetSqlContainerThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlContainerThroughput(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlContainerThroughput handles the response to the SqlResourcesGetSqlContainerThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlContainerThroughput(resp *http.Response) (result SqlResourcesGetSqlContainerThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabase_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabase_autorest.go new file mode 100644 index 000000000000..432f218e9778 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabase_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlDatabaseOperationResponse struct { + HttpResponse *http.Response + Model *SqlDatabaseGetResults +} + +// SqlResourcesGetSqlDatabase ... +func (c CosmosDBClient) SqlResourcesGetSqlDatabase(ctx context.Context, id SqlDatabaseId) (result SqlResourcesGetSqlDatabaseOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlDatabase(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabase", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabase", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlDatabase(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabase", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlDatabase prepares the SqlResourcesGetSqlDatabase request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlDatabase(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlDatabase handles the response to the SqlResourcesGetSqlDatabase request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlDatabase(resp *http.Response) (result SqlResourcesGetSqlDatabaseOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabasethroughput_autorest.go new file mode 100644 index 000000000000..3effade3c5f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqldatabasethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlDatabaseThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// SqlResourcesGetSqlDatabaseThroughput ... +func (c CosmosDBClient) SqlResourcesGetSqlDatabaseThroughput(ctx context.Context, id SqlDatabaseId) (result SqlResourcesGetSqlDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlDatabaseThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabaseThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlDatabaseThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlDatabaseThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlDatabaseThroughput prepares the SqlResourcesGetSqlDatabaseThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlDatabaseThroughput(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlDatabaseThroughput handles the response to the SqlResourcesGetSqlDatabaseThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlDatabaseThroughput(resp *http.Response) (result SqlResourcesGetSqlDatabaseThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlstoredprocedure_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlstoredprocedure_autorest.go new file mode 100644 index 000000000000..3c62ef3994d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqlstoredprocedure_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlStoredProcedureOperationResponse struct { + HttpResponse *http.Response + Model *SqlStoredProcedureGetResults +} + +// SqlResourcesGetSqlStoredProcedure ... +func (c CosmosDBClient) SqlResourcesGetSqlStoredProcedure(ctx context.Context, id StoredProcedureId) (result SqlResourcesGetSqlStoredProcedureOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlStoredProcedure(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlStoredProcedure", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlStoredProcedure", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlStoredProcedure(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlStoredProcedure", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlStoredProcedure prepares the SqlResourcesGetSqlStoredProcedure request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlStoredProcedure(ctx context.Context, id StoredProcedureId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlStoredProcedure handles the response to the SqlResourcesGetSqlStoredProcedure request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlStoredProcedure(resp *http.Response) (result SqlResourcesGetSqlStoredProcedureOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqltrigger_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqltrigger_autorest.go new file mode 100644 index 000000000000..3bd6341d2c3f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqltrigger_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlTriggerOperationResponse struct { + HttpResponse *http.Response + Model *SqlTriggerGetResults +} + +// SqlResourcesGetSqlTrigger ... +func (c CosmosDBClient) SqlResourcesGetSqlTrigger(ctx context.Context, id TriggerId) (result SqlResourcesGetSqlTriggerOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlTrigger(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlTrigger", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlTrigger", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlTrigger(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlTrigger", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlTrigger prepares the SqlResourcesGetSqlTrigger request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlTrigger(ctx context.Context, id TriggerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlTrigger handles the response to the SqlResourcesGetSqlTrigger request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlTrigger(resp *http.Response) (result SqlResourcesGetSqlTriggerOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqluserdefinedfunction_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqluserdefinedfunction_autorest.go new file mode 100644 index 000000000000..d228f591530c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesgetsqluserdefinedfunction_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesGetSqlUserDefinedFunctionOperationResponse struct { + HttpResponse *http.Response + Model *SqlUserDefinedFunctionGetResults +} + +// SqlResourcesGetSqlUserDefinedFunction ... +func (c CosmosDBClient) SqlResourcesGetSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId) (result SqlResourcesGetSqlUserDefinedFunctionOperationResponse, err error) { + req, err := c.preparerForSqlResourcesGetSqlUserDefinedFunction(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlUserDefinedFunction", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlUserDefinedFunction", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesGetSqlUserDefinedFunction(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesGetSqlUserDefinedFunction", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesGetSqlUserDefinedFunction prepares the SqlResourcesGetSqlUserDefinedFunction request. +func (c CosmosDBClient) preparerForSqlResourcesGetSqlUserDefinedFunction(ctx context.Context, id UserDefinedFunctionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesGetSqlUserDefinedFunction handles the response to the SqlResourcesGetSqlUserDefinedFunction request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesGetSqlUserDefinedFunction(resp *http.Response) (result SqlResourcesGetSqlUserDefinedFunctionOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistclientencryptionkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistclientencryptionkeys_autorest.go new file mode 100644 index 000000000000..47339a814595 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistclientencryptionkeys_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListClientEncryptionKeysOperationResponse struct { + HttpResponse *http.Response + Model *ClientEncryptionKeysListResult +} + +// SqlResourcesListClientEncryptionKeys ... +func (c CosmosDBClient) SqlResourcesListClientEncryptionKeys(ctx context.Context, id SqlDatabaseId) (result SqlResourcesListClientEncryptionKeysOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListClientEncryptionKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListClientEncryptionKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListClientEncryptionKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListClientEncryptionKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListClientEncryptionKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListClientEncryptionKeys prepares the SqlResourcesListClientEncryptionKeys request. +func (c CosmosDBClient) preparerForSqlResourcesListClientEncryptionKeys(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/clientEncryptionKeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListClientEncryptionKeys handles the response to the SqlResourcesListClientEncryptionKeys request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListClientEncryptionKeys(resp *http.Response) (result SqlResourcesListClientEncryptionKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlcontainers_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlcontainers_autorest.go new file mode 100644 index 000000000000..1a3dc13c0e22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlcontainers_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListSqlContainersOperationResponse struct { + HttpResponse *http.Response + Model *SqlContainerListResult +} + +// SqlResourcesListSqlContainers ... +func (c CosmosDBClient) SqlResourcesListSqlContainers(ctx context.Context, id SqlDatabaseId) (result SqlResourcesListSqlContainersOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListSqlContainers(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlContainers", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlContainers", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListSqlContainers(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlContainers", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListSqlContainers prepares the SqlResourcesListSqlContainers request. +func (c CosmosDBClient) preparerForSqlResourcesListSqlContainers(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/containers", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListSqlContainers handles the response to the SqlResourcesListSqlContainers request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListSqlContainers(resp *http.Response) (result SqlResourcesListSqlContainersOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqldatabases_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqldatabases_autorest.go new file mode 100644 index 000000000000..d43bbeca8890 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqldatabases_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListSqlDatabasesOperationResponse struct { + HttpResponse *http.Response + Model *SqlDatabaseListResult +} + +// SqlResourcesListSqlDatabases ... +func (c CosmosDBClient) SqlResourcesListSqlDatabases(ctx context.Context, id DatabaseAccountId) (result SqlResourcesListSqlDatabasesOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListSqlDatabases(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlDatabases", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlDatabases", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListSqlDatabases(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlDatabases", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListSqlDatabases prepares the SqlResourcesListSqlDatabases request. +func (c CosmosDBClient) preparerForSqlResourcesListSqlDatabases(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/sqlDatabases", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListSqlDatabases handles the response to the SqlResourcesListSqlDatabases request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListSqlDatabases(resp *http.Response) (result SqlResourcesListSqlDatabasesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlstoredprocedures_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlstoredprocedures_autorest.go new file mode 100644 index 000000000000..90aacee43b8a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqlstoredprocedures_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListSqlStoredProceduresOperationResponse struct { + HttpResponse *http.Response + Model *SqlStoredProcedureListResult +} + +// SqlResourcesListSqlStoredProcedures ... +func (c CosmosDBClient) SqlResourcesListSqlStoredProcedures(ctx context.Context, id ContainerId) (result SqlResourcesListSqlStoredProceduresOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListSqlStoredProcedures(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlStoredProcedures", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlStoredProcedures", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListSqlStoredProcedures(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlStoredProcedures", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListSqlStoredProcedures prepares the SqlResourcesListSqlStoredProcedures request. +func (c CosmosDBClient) preparerForSqlResourcesListSqlStoredProcedures(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/storedProcedures", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListSqlStoredProcedures handles the response to the SqlResourcesListSqlStoredProcedures request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListSqlStoredProcedures(resp *http.Response) (result SqlResourcesListSqlStoredProceduresOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqltriggers_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqltriggers_autorest.go new file mode 100644 index 000000000000..ba363073bc9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqltriggers_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListSqlTriggersOperationResponse struct { + HttpResponse *http.Response + Model *SqlTriggerListResult +} + +// SqlResourcesListSqlTriggers ... +func (c CosmosDBClient) SqlResourcesListSqlTriggers(ctx context.Context, id ContainerId) (result SqlResourcesListSqlTriggersOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListSqlTriggers(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlTriggers", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlTriggers", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListSqlTriggers(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlTriggers", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListSqlTriggers prepares the SqlResourcesListSqlTriggers request. +func (c CosmosDBClient) preparerForSqlResourcesListSqlTriggers(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/triggers", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListSqlTriggers handles the response to the SqlResourcesListSqlTriggers request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListSqlTriggers(resp *http.Response) (result SqlResourcesListSqlTriggersOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqluserdefinedfunctions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqluserdefinedfunctions_autorest.go new file mode 100644 index 000000000000..146af4e2888b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourceslistsqluserdefinedfunctions_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesListSqlUserDefinedFunctionsOperationResponse struct { + HttpResponse *http.Response + Model *SqlUserDefinedFunctionListResult +} + +// SqlResourcesListSqlUserDefinedFunctions ... +func (c CosmosDBClient) SqlResourcesListSqlUserDefinedFunctions(ctx context.Context, id ContainerId) (result SqlResourcesListSqlUserDefinedFunctionsOperationResponse, err error) { + req, err := c.preparerForSqlResourcesListSqlUserDefinedFunctions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlUserDefinedFunctions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlUserDefinedFunctions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSqlResourcesListSqlUserDefinedFunctions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesListSqlUserDefinedFunctions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSqlResourcesListSqlUserDefinedFunctions prepares the SqlResourcesListSqlUserDefinedFunctions request. +func (c CosmosDBClient) preparerForSqlResourcesListSqlUserDefinedFunctions(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/userDefinedFunctions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSqlResourcesListSqlUserDefinedFunctions handles the response to the SqlResourcesListSqlUserDefinedFunctions request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForSqlResourcesListSqlUserDefinedFunctions(resp *http.Response) (result SqlResourcesListSqlUserDefinedFunctionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertoautoscale_autorest.go new file mode 100644 index 000000000000..7f6f20b181a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesMigrateSqlContainerToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesMigrateSqlContainerToAutoscale ... +func (c CosmosDBClient) SqlResourcesMigrateSqlContainerToAutoscale(ctx context.Context, id ContainerId) (result SqlResourcesMigrateSqlContainerToAutoscaleOperationResponse, err error) { + req, err := c.preparerForSqlResourcesMigrateSqlContainerToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlContainerToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesMigrateSqlContainerToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlContainerToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesMigrateSqlContainerToAutoscaleThenPoll performs SqlResourcesMigrateSqlContainerToAutoscale then polls until it's completed +func (c CosmosDBClient) SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx context.Context, id ContainerId) error { + result, err := c.SqlResourcesMigrateSqlContainerToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesMigrateSqlContainerToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesMigrateSqlContainerToAutoscale: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesMigrateSqlContainerToAutoscale prepares the SqlResourcesMigrateSqlContainerToAutoscale request. +func (c CosmosDBClient) preparerForSqlResourcesMigrateSqlContainerToAutoscale(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesMigrateSqlContainerToAutoscale sends the SqlResourcesMigrateSqlContainerToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesMigrateSqlContainerToAutoscale(ctx context.Context, req *http.Request) (future SqlResourcesMigrateSqlContainerToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertomanualthroughput_autorest.go new file mode 100644 index 000000000000..e59543f93f7c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqlcontainertomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesMigrateSqlContainerToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesMigrateSqlContainerToManualThroughput ... +func (c CosmosDBClient) SqlResourcesMigrateSqlContainerToManualThroughput(ctx context.Context, id ContainerId) (result SqlResourcesMigrateSqlContainerToManualThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesMigrateSqlContainerToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlContainerToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesMigrateSqlContainerToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlContainerToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesMigrateSqlContainerToManualThroughputThenPoll performs SqlResourcesMigrateSqlContainerToManualThroughput then polls until it's completed +func (c CosmosDBClient) SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx context.Context, id ContainerId) error { + result, err := c.SqlResourcesMigrateSqlContainerToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesMigrateSqlContainerToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesMigrateSqlContainerToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesMigrateSqlContainerToManualThroughput prepares the SqlResourcesMigrateSqlContainerToManualThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesMigrateSqlContainerToManualThroughput(ctx context.Context, id ContainerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesMigrateSqlContainerToManualThroughput sends the SqlResourcesMigrateSqlContainerToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesMigrateSqlContainerToManualThroughput(ctx context.Context, req *http.Request) (future SqlResourcesMigrateSqlContainerToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetoautoscale_autorest.go new file mode 100644 index 000000000000..e35381da883b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesMigrateSqlDatabaseToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesMigrateSqlDatabaseToAutoscale ... +func (c CosmosDBClient) SqlResourcesMigrateSqlDatabaseToAutoscale(ctx context.Context, id SqlDatabaseId) (result SqlResourcesMigrateSqlDatabaseToAutoscaleOperationResponse, err error) { + req, err := c.preparerForSqlResourcesMigrateSqlDatabaseToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesMigrateSqlDatabaseToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlDatabaseToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll performs SqlResourcesMigrateSqlDatabaseToAutoscale then polls until it's completed +func (c CosmosDBClient) SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx context.Context, id SqlDatabaseId) error { + result, err := c.SqlResourcesMigrateSqlDatabaseToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesMigrateSqlDatabaseToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesMigrateSqlDatabaseToAutoscale: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesMigrateSqlDatabaseToAutoscale prepares the SqlResourcesMigrateSqlDatabaseToAutoscale request. +func (c CosmosDBClient) preparerForSqlResourcesMigrateSqlDatabaseToAutoscale(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesMigrateSqlDatabaseToAutoscale sends the SqlResourcesMigrateSqlDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesMigrateSqlDatabaseToAutoscale(ctx context.Context, req *http.Request) (future SqlResourcesMigrateSqlDatabaseToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetomanualthroughput_autorest.go new file mode 100644 index 000000000000..bb18824c87da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesmigratesqldatabasetomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesMigrateSqlDatabaseToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesMigrateSqlDatabaseToManualThroughput ... +func (c CosmosDBClient) SqlResourcesMigrateSqlDatabaseToManualThroughput(ctx context.Context, id SqlDatabaseId) (result SqlResourcesMigrateSqlDatabaseToManualThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesMigrateSqlDatabaseToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesMigrateSqlDatabaseToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesMigrateSqlDatabaseToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll performs SqlResourcesMigrateSqlDatabaseToManualThroughput then polls until it's completed +func (c CosmosDBClient) SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx context.Context, id SqlDatabaseId) error { + result, err := c.SqlResourcesMigrateSqlDatabaseToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing SqlResourcesMigrateSqlDatabaseToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesMigrateSqlDatabaseToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesMigrateSqlDatabaseToManualThroughput prepares the SqlResourcesMigrateSqlDatabaseToManualThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesMigrateSqlDatabaseToManualThroughput(ctx context.Context, id SqlDatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesMigrateSqlDatabaseToManualThroughput sends the SqlResourcesMigrateSqlDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesMigrateSqlDatabaseToManualThroughput(ctx context.Context, req *http.Request) (future SqlResourcesMigrateSqlDatabaseToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqlcontainerthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqlcontainerthroughput_autorest.go new file mode 100644 index 000000000000..ad0008bc13f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqlcontainerthroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesUpdateSqlContainerThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesUpdateSqlContainerThroughput ... +func (c CosmosDBClient) SqlResourcesUpdateSqlContainerThroughput(ctx context.Context, id ContainerId, input ThroughputSettingsUpdateParameters) (result SqlResourcesUpdateSqlContainerThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesUpdateSqlContainerThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesUpdateSqlContainerThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesUpdateSqlContainerThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesUpdateSqlContainerThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesUpdateSqlContainerThroughputThenPoll performs SqlResourcesUpdateSqlContainerThroughput then polls until it's completed +func (c CosmosDBClient) SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx context.Context, id ContainerId, input ThroughputSettingsUpdateParameters) error { + result, err := c.SqlResourcesUpdateSqlContainerThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesUpdateSqlContainerThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesUpdateSqlContainerThroughput: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesUpdateSqlContainerThroughput prepares the SqlResourcesUpdateSqlContainerThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesUpdateSqlContainerThroughput(ctx context.Context, id ContainerId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesUpdateSqlContainerThroughput sends the SqlResourcesUpdateSqlContainerThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesUpdateSqlContainerThroughput(ctx context.Context, req *http.Request) (future SqlResourcesUpdateSqlContainerThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqldatabasethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqldatabasethroughput_autorest.go new file mode 100644 index 000000000000..13fed60b8386 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_sqlresourcesupdatesqldatabasethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlResourcesUpdateSqlDatabaseThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SqlResourcesUpdateSqlDatabaseThroughput ... +func (c CosmosDBClient) SqlResourcesUpdateSqlDatabaseThroughput(ctx context.Context, id SqlDatabaseId, input ThroughputSettingsUpdateParameters) (result SqlResourcesUpdateSqlDatabaseThroughputOperationResponse, err error) { + req, err := c.preparerForSqlResourcesUpdateSqlDatabaseThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesUpdateSqlDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForSqlResourcesUpdateSqlDatabaseThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "SqlResourcesUpdateSqlDatabaseThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SqlResourcesUpdateSqlDatabaseThroughputThenPoll performs SqlResourcesUpdateSqlDatabaseThroughput then polls until it's completed +func (c CosmosDBClient) SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx context.Context, id SqlDatabaseId, input ThroughputSettingsUpdateParameters) error { + result, err := c.SqlResourcesUpdateSqlDatabaseThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SqlResourcesUpdateSqlDatabaseThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SqlResourcesUpdateSqlDatabaseThroughput: %+v", err) + } + + return nil +} + +// preparerForSqlResourcesUpdateSqlDatabaseThroughput prepares the SqlResourcesUpdateSqlDatabaseThroughput request. +func (c CosmosDBClient) preparerForSqlResourcesUpdateSqlDatabaseThroughput(ctx context.Context, id SqlDatabaseId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSqlResourcesUpdateSqlDatabaseThroughput sends the SqlResourcesUpdateSqlDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForSqlResourcesUpdateSqlDatabaseThroughput(ctx context.Context, req *http.Request) (future SqlResourcesUpdateSqlDatabaseThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcescreateupdatetable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcescreateupdatetable_autorest.go new file mode 100644 index 000000000000..5a2445d28d18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcescreateupdatetable_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesCreateUpdateTableOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// TableResourcesCreateUpdateTable ... +func (c CosmosDBClient) TableResourcesCreateUpdateTable(ctx context.Context, id TableId, input TableCreateUpdateParameters) (result TableResourcesCreateUpdateTableOperationResponse, err error) { + req, err := c.preparerForTableResourcesCreateUpdateTable(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesCreateUpdateTable", nil, "Failure preparing request") + return + } + + result, err = c.senderForTableResourcesCreateUpdateTable(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesCreateUpdateTable", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// TableResourcesCreateUpdateTableThenPoll performs TableResourcesCreateUpdateTable then polls until it's completed +func (c CosmosDBClient) TableResourcesCreateUpdateTableThenPoll(ctx context.Context, id TableId, input TableCreateUpdateParameters) error { + result, err := c.TableResourcesCreateUpdateTable(ctx, id, input) + if err != nil { + return fmt.Errorf("performing TableResourcesCreateUpdateTable: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after TableResourcesCreateUpdateTable: %+v", err) + } + + return nil +} + +// preparerForTableResourcesCreateUpdateTable prepares the TableResourcesCreateUpdateTable request. +func (c CosmosDBClient) preparerForTableResourcesCreateUpdateTable(ctx context.Context, id TableId, input TableCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForTableResourcesCreateUpdateTable sends the TableResourcesCreateUpdateTable request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForTableResourcesCreateUpdateTable(ctx context.Context, req *http.Request) (future TableResourcesCreateUpdateTableOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesdeletetable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesdeletetable_autorest.go new file mode 100644 index 000000000000..461c34819df2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesdeletetable_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesDeleteTableOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// TableResourcesDeleteTable ... +func (c CosmosDBClient) TableResourcesDeleteTable(ctx context.Context, id TableId) (result TableResourcesDeleteTableOperationResponse, err error) { + req, err := c.preparerForTableResourcesDeleteTable(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesDeleteTable", nil, "Failure preparing request") + return + } + + result, err = c.senderForTableResourcesDeleteTable(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesDeleteTable", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// TableResourcesDeleteTableThenPoll performs TableResourcesDeleteTable then polls until it's completed +func (c CosmosDBClient) TableResourcesDeleteTableThenPoll(ctx context.Context, id TableId) error { + result, err := c.TableResourcesDeleteTable(ctx, id) + if err != nil { + return fmt.Errorf("performing TableResourcesDeleteTable: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after TableResourcesDeleteTable: %+v", err) + } + + return nil +} + +// preparerForTableResourcesDeleteTable prepares the TableResourcesDeleteTable request. +func (c CosmosDBClient) preparerForTableResourcesDeleteTable(ctx context.Context, id TableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForTableResourcesDeleteTable sends the TableResourcesDeleteTable request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForTableResourcesDeleteTable(ctx context.Context, req *http.Request) (future TableResourcesDeleteTableOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettable_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettable_autorest.go new file mode 100644 index 000000000000..398d6f4c49cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettable_autorest.go @@ -0,0 +1,68 @@ +package cosmosdb + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesGetTableOperationResponse struct { + HttpResponse *http.Response + Model *TableGetResults +} + +// TableResourcesGetTable ... +func (c CosmosDBClient) TableResourcesGetTable(ctx context.Context, id TableId) (result TableResourcesGetTableOperationResponse, err error) { + req, err := c.preparerForTableResourcesGetTable(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTable", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTable", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForTableResourcesGetTable(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTable", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForTableResourcesGetTable prepares the TableResourcesGetTable request. +func (c CosmosDBClient) preparerForTableResourcesGetTable(ctx context.Context, id TableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForTableResourcesGetTable handles the response to the TableResourcesGetTable request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForTableResourcesGetTable(resp *http.Response) (result TableResourcesGetTableOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettablethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettablethroughput_autorest.go new file mode 100644 index 000000000000..77e49777b88e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesgettablethroughput_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesGetTableThroughputOperationResponse struct { + HttpResponse *http.Response + Model *ThroughputSettingsGetResults +} + +// TableResourcesGetTableThroughput ... +func (c CosmosDBClient) TableResourcesGetTableThroughput(ctx context.Context, id TableId) (result TableResourcesGetTableThroughputOperationResponse, err error) { + req, err := c.preparerForTableResourcesGetTableThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTableThroughput", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTableThroughput", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForTableResourcesGetTableThroughput(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesGetTableThroughput", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForTableResourcesGetTableThroughput prepares the TableResourcesGetTableThroughput request. +func (c CosmosDBClient) preparerForTableResourcesGetTableThroughput(ctx context.Context, id TableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForTableResourcesGetTableThroughput handles the response to the TableResourcesGetTableThroughput request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForTableResourcesGetTableThroughput(resp *http.Response) (result TableResourcesGetTableThroughputOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourceslisttables_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourceslisttables_autorest.go new file mode 100644 index 000000000000..33d2a6cefd58 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourceslisttables_autorest.go @@ -0,0 +1,69 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesListTablesOperationResponse struct { + HttpResponse *http.Response + Model *TableListResult +} + +// TableResourcesListTables ... +func (c CosmosDBClient) TableResourcesListTables(ctx context.Context, id DatabaseAccountId) (result TableResourcesListTablesOperationResponse, err error) { + req, err := c.preparerForTableResourcesListTables(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesListTables", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesListTables", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForTableResourcesListTables(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesListTables", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForTableResourcesListTables prepares the TableResourcesListTables request. +func (c CosmosDBClient) preparerForTableResourcesListTables(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/tables", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForTableResourcesListTables handles the response to the TableResourcesListTables request. The method always +// closes the http.Response Body. +func (c CosmosDBClient) responderForTableResourcesListTables(resp *http.Response) (result TableResourcesListTablesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletoautoscale_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletoautoscale_autorest.go new file mode 100644 index 000000000000..c0ec646013a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletoautoscale_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesMigrateTableToAutoscaleOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// TableResourcesMigrateTableToAutoscale ... +func (c CosmosDBClient) TableResourcesMigrateTableToAutoscale(ctx context.Context, id TableId) (result TableResourcesMigrateTableToAutoscaleOperationResponse, err error) { + req, err := c.preparerForTableResourcesMigrateTableToAutoscale(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesMigrateTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = c.senderForTableResourcesMigrateTableToAutoscale(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesMigrateTableToAutoscale", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// TableResourcesMigrateTableToAutoscaleThenPoll performs TableResourcesMigrateTableToAutoscale then polls until it's completed +func (c CosmosDBClient) TableResourcesMigrateTableToAutoscaleThenPoll(ctx context.Context, id TableId) error { + result, err := c.TableResourcesMigrateTableToAutoscale(ctx, id) + if err != nil { + return fmt.Errorf("performing TableResourcesMigrateTableToAutoscale: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after TableResourcesMigrateTableToAutoscale: %+v", err) + } + + return nil +} + +// preparerForTableResourcesMigrateTableToAutoscale prepares the TableResourcesMigrateTableToAutoscale request. +func (c CosmosDBClient) preparerForTableResourcesMigrateTableToAutoscale(ctx context.Context, id TableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToAutoscale", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForTableResourcesMigrateTableToAutoscale sends the TableResourcesMigrateTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForTableResourcesMigrateTableToAutoscale(ctx context.Context, req *http.Request) (future TableResourcesMigrateTableToAutoscaleOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletomanualthroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletomanualthroughput_autorest.go new file mode 100644 index 000000000000..08310f65b3b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesmigratetabletomanualthroughput_autorest.go @@ -0,0 +1,78 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesMigrateTableToManualThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// TableResourcesMigrateTableToManualThroughput ... +func (c CosmosDBClient) TableResourcesMigrateTableToManualThroughput(ctx context.Context, id TableId) (result TableResourcesMigrateTableToManualThroughputOperationResponse, err error) { + req, err := c.preparerForTableResourcesMigrateTableToManualThroughput(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesMigrateTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForTableResourcesMigrateTableToManualThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesMigrateTableToManualThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// TableResourcesMigrateTableToManualThroughputThenPoll performs TableResourcesMigrateTableToManualThroughput then polls until it's completed +func (c CosmosDBClient) TableResourcesMigrateTableToManualThroughputThenPoll(ctx context.Context, id TableId) error { + result, err := c.TableResourcesMigrateTableToManualThroughput(ctx, id) + if err != nil { + return fmt.Errorf("performing TableResourcesMigrateTableToManualThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after TableResourcesMigrateTableToManualThroughput: %+v", err) + } + + return nil +} + +// preparerForTableResourcesMigrateTableToManualThroughput prepares the TableResourcesMigrateTableToManualThroughput request. +func (c CosmosDBClient) preparerForTableResourcesMigrateTableToManualThroughput(ctx context.Context, id TableId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default/migrateToManualThroughput", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForTableResourcesMigrateTableToManualThroughput sends the TableResourcesMigrateTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForTableResourcesMigrateTableToManualThroughput(ctx context.Context, req *http.Request) (future TableResourcesMigrateTableToManualThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesupdatetablethroughput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesupdatetablethroughput_autorest.go new file mode 100644 index 000000000000..3de858ac7e68 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/method_tableresourcesupdatetablethroughput_autorest.go @@ -0,0 +1,79 @@ +package cosmosdb + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResourcesUpdateTableThroughputOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// TableResourcesUpdateTableThroughput ... +func (c CosmosDBClient) TableResourcesUpdateTableThroughput(ctx context.Context, id TableId, input ThroughputSettingsUpdateParameters) (result TableResourcesUpdateTableThroughputOperationResponse, err error) { + req, err := c.preparerForTableResourcesUpdateTableThroughput(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesUpdateTableThroughput", nil, "Failure preparing request") + return + } + + result, err = c.senderForTableResourcesUpdateTableThroughput(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "cosmosdb.CosmosDBClient", "TableResourcesUpdateTableThroughput", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// TableResourcesUpdateTableThroughputThenPoll performs TableResourcesUpdateTableThroughput then polls until it's completed +func (c CosmosDBClient) TableResourcesUpdateTableThroughputThenPoll(ctx context.Context, id TableId, input ThroughputSettingsUpdateParameters) error { + result, err := c.TableResourcesUpdateTableThroughput(ctx, id, input) + if err != nil { + return fmt.Errorf("performing TableResourcesUpdateTableThroughput: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after TableResourcesUpdateTableThroughput: %+v", err) + } + + return nil +} + +// preparerForTableResourcesUpdateTableThroughput prepares the TableResourcesUpdateTableThroughput request. +func (c CosmosDBClient) preparerForTableResourcesUpdateTableThroughput(ctx context.Context, id TableId, input ThroughputSettingsUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/throughputSettings/default", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForTableResourcesUpdateTableThroughput sends the TableResourcesUpdateTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (c CosmosDBClient) senderForTableResourcesUpdateTableThroughput(ctx context.Context, req *http.Request) (future TableResourcesUpdateTableThroughputOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_accountkeymetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_accountkeymetadata.go new file mode 100644 index 000000000000..84fc00031f66 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_accountkeymetadata.go @@ -0,0 +1,26 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountKeyMetadata struct { + GenerationTime *string `json:"generationTime,omitempty"` +} + +func (o *AccountKeyMetadata) GetGenerationTimeAsTime() (*time.Time, error) { + if o.GenerationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.GenerationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *AccountKeyMetadata) SetGenerationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.GenerationTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_analyticalstorageconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_analyticalstorageconfiguration.go new file mode 100644 index 000000000000..181589d115f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_analyticalstorageconfiguration.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AnalyticalStorageConfiguration struct { + SchemaType *AnalyticalStorageSchemaType `json:"schemaType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_apiproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_apiproperties.go new file mode 100644 index 000000000000..231040ab44db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_apiproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApiProperties struct { + ServerVersion *ServerVersion `json:"serverVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettings.go new file mode 100644 index 000000000000..bfe5f5bc0850 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettings.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoScaleSettings struct { + MaxThroughput *int64 `json:"maxThroughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettingsresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettingsresource.go new file mode 100644 index 000000000000..2dae67d529f6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoscalesettingsresource.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoscaleSettingsResource struct { + AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"` + MaxThroughput int64 `json:"maxThroughput"` + TargetMaxThroughput *int64 `json:"targetMaxThroughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoupgradepolicyresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoupgradepolicyresource.go new file mode 100644 index 000000000000..db0d65bbc3ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_autoupgradepolicyresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoUpgradePolicyResource struct { + ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicy.go new file mode 100644 index 000000000000..5cfeef1ae1c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicy.go @@ -0,0 +1,56 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPolicy interface { +} + +func unmarshalBackupPolicyImplementation(input []byte) (BackupPolicy, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling BackupPolicy into map[string]interface: %+v", err) + } + + value, ok := temp["type"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Continuous") { + var out ContinuousModeBackupPolicy + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ContinuousModeBackupPolicy: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Periodic") { + var out PeriodicModeBackupPolicy + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PeriodicModeBackupPolicy: %+v", err) + } + return out, nil + } + + type RawBackupPolicyImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawBackupPolicyImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicymigrationstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicymigrationstate.go new file mode 100644 index 000000000000..f23938e53e7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_backuppolicymigrationstate.go @@ -0,0 +1,28 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPolicyMigrationState struct { + StartTime *string `json:"startTime,omitempty"` + Status *BackupPolicyMigrationStatus `json:"status,omitempty"` + TargetType *BackupPolicyType `json:"targetType,omitempty"` +} + +func (o *BackupPolicyMigrationState) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupPolicyMigrationState) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capability.go new file mode 100644 index 000000000000..4306e287902d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capability.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Capability struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capacity.go new file mode 100644 index 000000000000..e2cb98715db2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_capacity.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Capacity struct { + TotalThroughputLimit *int64 `json:"totalThroughputLimit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateparameters.go new file mode 100644 index 000000000000..1b73cec354fc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties CassandraKeyspaceCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateproperties.go new file mode 100644 index 000000000000..80ff43847f0f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource CassandraKeyspaceResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetproperties.go new file mode 100644 index 000000000000..a7a96dced5fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *CassandraKeyspaceGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetresults.go new file mode 100644 index 000000000000..7a3f647c293e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *CassandraKeyspaceGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacelistresult.go new file mode 100644 index 000000000000..8b8cd939ed99 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspacelistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceListResult struct { + Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspaceresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspaceresource.go new file mode 100644 index 000000000000..2000e0881809 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrakeyspaceresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraKeyspaceResource struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrapartitionkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrapartitionkey.go new file mode 100644 index 000000000000..5c50c3d8a6d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandrapartitionkey.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraPartitionKey struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandraschema.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandraschema.go new file mode 100644 index 000000000000..9d498a2a8980 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandraschema.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraSchema struct { + ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"` + Columns *[]Column `json:"columns,omitempty"` + PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateparameters.go new file mode 100644 index 000000000000..e011ba225197 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties CassandraTableCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateproperties.go new file mode 100644 index 000000000000..f08596cf88ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource CassandraTableResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetproperties.go new file mode 100644 index 000000000000..a8d1899ae07c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *CassandraTableGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetresults.go new file mode 100644 index 000000000000..f4b82a41cb6b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *CassandraTableGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablelistresult.go new file mode 100644 index 000000000000..3b7a0f6a9595 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratablelistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableListResult struct { + Value *[]CassandraTableGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratableresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratableresource.go new file mode 100644 index 000000000000..7c20f9bf4963 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_cassandratableresource.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableResource struct { + AnalyticalStorageTtl *int64 `json:"analyticalStorageTtl,omitempty"` + DefaultTtl *int64 `json:"defaultTtl,omitempty"` + Id string `json:"id"` + Schema *CassandraSchema `json:"schema,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionincludedpath.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionincludedpath.go new file mode 100644 index 000000000000..58a0a131becd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionincludedpath.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionIncludedPath struct { + ClientEncryptionKeyId string `json:"clientEncryptionKeyId"` + EncryptionAlgorithm string `json:"encryptionAlgorithm"` + EncryptionType string `json:"encryptionType"` + Path string `json:"path"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateparameters.go new file mode 100644 index 000000000000..f72409baaa3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateparameters.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeyCreateUpdateParameters struct { + Properties ClientEncryptionKeyCreateUpdateProperties `json:"properties"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateproperties.go new file mode 100644 index 000000000000..be2c9c68503a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeycreateupdateproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeyCreateUpdateProperties struct { + Resource ClientEncryptionKeyResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetproperties.go new file mode 100644 index 000000000000..fe53efb1785a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeyGetProperties struct { + Resource *ClientEncryptionKeyGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetresults.go new file mode 100644 index 000000000000..5c83f184f962 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeygetresults.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeyGetResults struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ClientEncryptionKeyGetProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyresource.go new file mode 100644 index 000000000000..ddccb42a0bce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyresource.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeyResource struct { + EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` + Id *string `json:"id,omitempty"` + KeyWrapMetadata *KeyWrapMetadata `json:"keyWrapMetadata,omitempty"` + WrappedDataEncryptionKey *string `json:"wrappedDataEncryptionKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyslistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyslistresult.go new file mode 100644 index 000000000000..43f7501528f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionkeyslistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionKeysListResult struct { + Value *[]ClientEncryptionKeyGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionpolicy.go new file mode 100644 index 000000000000..6e692a77332a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clientencryptionpolicy.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClientEncryptionPolicy struct { + IncludedPaths []ClientEncryptionIncludedPath `json:"includedPaths"` + PolicyFormatVersion int64 `json:"policyFormatVersion"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clusterkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clusterkey.go new file mode 100644 index 000000000000..1f3a0293d8ca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_clusterkey.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterKey struct { + Name *string `json:"name,omitempty"` + OrderBy *string `json:"orderBy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_column.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_column.go new file mode 100644 index 000000000000..954c47686b80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_column.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Column struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_compositepath.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_compositepath.go new file mode 100644 index 000000000000..33a9d51ace7a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_compositepath.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CompositePath struct { + Order *CompositePathSortOrder `json:"order,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_conflictresolutionpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_conflictresolutionpolicy.go new file mode 100644 index 000000000000..83eb7abe76c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_conflictresolutionpolicy.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConflictResolutionPolicy struct { + ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"` + ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"` + Mode *ConflictResolutionMode `json:"mode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_consistencypolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_consistencypolicy.go new file mode 100644 index 000000000000..07ce2103f5a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_consistencypolicy.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConsistencyPolicy struct { + DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel"` + MaxIntervalInSeconds *int64 `json:"maxIntervalInSeconds,omitempty"` + MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_containerpartitionkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_containerpartitionkey.go new file mode 100644 index 000000000000..ee0d47799d1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_containerpartitionkey.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerPartitionKey struct { + Kind *PartitionKind `json:"kind,omitempty"` + Paths *[]string `json:"paths,omitempty"` + SystemKey *bool `json:"systemKey,omitempty"` + Version *int64 `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_continuousmodebackuppolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_continuousmodebackuppolicy.go new file mode 100644 index 000000000000..f23ae252bb69 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_continuousmodebackuppolicy.go @@ -0,0 +1,41 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ BackupPolicy = ContinuousModeBackupPolicy{} + +type ContinuousModeBackupPolicy struct { + + // Fields inherited from BackupPolicy + MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` +} + +var _ json.Marshaler = ContinuousModeBackupPolicy{} + +func (s ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { + type wrapper ContinuousModeBackupPolicy + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ContinuousModeBackupPolicy: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ContinuousModeBackupPolicy: %+v", err) + } + decoded["type"] = "Continuous" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ContinuousModeBackupPolicy: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_corspolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_corspolicy.go new file mode 100644 index 000000000000..99bbc49c9727 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_corspolicy.go @@ -0,0 +1,12 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CorsPolicy struct { + AllowedHeaders *string `json:"allowedHeaders,omitempty"` + AllowedMethods *string `json:"allowedMethods,omitempty"` + AllowedOrigins string `json:"allowedOrigins"` + ExposedHeaders *string `json:"exposedHeaders,omitempty"` + MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_createupdateoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_createupdateoptions.go new file mode 100644 index 000000000000..050689a321ee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_createupdateoptions.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateUpdateOptions struct { + AutoScaleSettings *AutoScaleSettings `json:"autoscaleSettings,omitempty"` + Throughput *int64 `json:"throughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountconnectionstring.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountconnectionstring.go new file mode 100644 index 000000000000..eae7b01ccfa2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountconnectionstring.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountConnectionString struct { + ConnectionString *string `json:"connectionString,omitempty"` + Description *string `json:"description,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateparameters.go new file mode 100644 index 000000000000..a33d5146a815 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateparameters.go @@ -0,0 +1,19 @@ +package cosmosdb + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Kind *DatabaseAccountKind `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties DatabaseAccountCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateproperties.go new file mode 100644 index 000000000000..84aa318b5482 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountcreateupdateproperties.go @@ -0,0 +1,96 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountCreateUpdateProperties struct { + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + ApiProperties *ApiProperties `json:"apiProperties,omitempty"` + BackupPolicy BackupPolicy `json:"backupPolicy"` + Capabilities *[]Capability `json:"capabilities,omitempty"` + Capacity *Capacity `json:"capacity,omitempty"` + ConnectorOffer *ConnectorOffer `json:"connectorOffer,omitempty"` + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + Cors *[]CorsPolicy `json:"cors,omitempty"` + CreateMode *CreateMode `json:"createMode,omitempty"` + DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType"` + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"` + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` + Locations []Location `json:"locations"` + MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"` + NetworkAclBypass *NetworkAclBypass `json:"networkAclBypass,omitempty"` + NetworkAclBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` +} + +var _ json.Unmarshaler = &DatabaseAccountCreateUpdateProperties{} + +func (s *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(bytes []byte) error { + type alias DatabaseAccountCreateUpdateProperties + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into DatabaseAccountCreateUpdateProperties: %+v", err) + } + + s.AnalyticalStorageConfiguration = decoded.AnalyticalStorageConfiguration + s.ApiProperties = decoded.ApiProperties + s.Capabilities = decoded.Capabilities + s.Capacity = decoded.Capacity + s.ConnectorOffer = decoded.ConnectorOffer + s.ConsistencyPolicy = decoded.ConsistencyPolicy + s.Cors = decoded.Cors + s.CreateMode = decoded.CreateMode + s.DatabaseAccountOfferType = decoded.DatabaseAccountOfferType + s.DefaultIdentity = decoded.DefaultIdentity + s.DisableKeyBasedMetadataWriteAccess = decoded.DisableKeyBasedMetadataWriteAccess + s.DisableLocalAuth = decoded.DisableLocalAuth + s.EnableAnalyticalStorage = decoded.EnableAnalyticalStorage + s.EnableAutomaticFailover = decoded.EnableAutomaticFailover + s.EnableCassandraConnector = decoded.EnableCassandraConnector + s.EnableFreeTier = decoded.EnableFreeTier + s.EnableMultipleWriteLocations = decoded.EnableMultipleWriteLocations + s.EnablePartitionMerge = decoded.EnablePartitionMerge + s.IPRules = decoded.IPRules + s.IsVirtualNetworkFilterEnabled = decoded.IsVirtualNetworkFilterEnabled + s.KeyVaultKeyUri = decoded.KeyVaultKeyUri + s.KeysMetadata = decoded.KeysMetadata + s.Locations = decoded.Locations + s.MinimalTlsVersion = decoded.MinimalTlsVersion + s.NetworkAclBypass = decoded.NetworkAclBypass + s.NetworkAclBypassResourceIds = decoded.NetworkAclBypassResourceIds + s.PublicNetworkAccess = decoded.PublicNetworkAccess + s.RestoreParameters = decoded.RestoreParameters + s.VirtualNetworkRules = decoded.VirtualNetworkRules + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DatabaseAccountCreateUpdateProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["backupPolicy"]; ok { + impl, err := unmarshalBackupPolicyImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'BackupPolicy' for 'DatabaseAccountCreateUpdateProperties': %+v", err) + } + s.BackupPolicy = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetproperties.go new file mode 100644 index 000000000000..f7f26903545c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetproperties.go @@ -0,0 +1,110 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountGetProperties struct { + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + ApiProperties *ApiProperties `json:"apiProperties,omitempty"` + BackupPolicy BackupPolicy `json:"backupPolicy"` + Capabilities *[]Capability `json:"capabilities,omitempty"` + Capacity *Capacity `json:"capacity,omitempty"` + ConnectorOffer *ConnectorOffer `json:"connectorOffer,omitempty"` + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + Cors *[]CorsPolicy `json:"cors,omitempty"` + CreateMode *CreateMode `json:"createMode,omitempty"` + DatabaseAccountOfferType *DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + InstanceId *string `json:"instanceId,omitempty"` + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"` + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` + Locations *[]Location `json:"locations,omitempty"` + MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"` + NetworkAclBypass *NetworkAclBypass `json:"networkAclBypass,omitempty"` + NetworkAclBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ReadLocations *[]Location `json:"readLocations,omitempty"` + RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + WriteLocations *[]Location `json:"writeLocations,omitempty"` +} + +var _ json.Unmarshaler = &DatabaseAccountGetProperties{} + +func (s *DatabaseAccountGetProperties) UnmarshalJSON(bytes []byte) error { + type alias DatabaseAccountGetProperties + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into DatabaseAccountGetProperties: %+v", err) + } + + s.AnalyticalStorageConfiguration = decoded.AnalyticalStorageConfiguration + s.ApiProperties = decoded.ApiProperties + s.Capabilities = decoded.Capabilities + s.Capacity = decoded.Capacity + s.ConnectorOffer = decoded.ConnectorOffer + s.ConsistencyPolicy = decoded.ConsistencyPolicy + s.Cors = decoded.Cors + s.CreateMode = decoded.CreateMode + s.DatabaseAccountOfferType = decoded.DatabaseAccountOfferType + s.DefaultIdentity = decoded.DefaultIdentity + s.DisableKeyBasedMetadataWriteAccess = decoded.DisableKeyBasedMetadataWriteAccess + s.DisableLocalAuth = decoded.DisableLocalAuth + s.DocumentEndpoint = decoded.DocumentEndpoint + s.EnableAnalyticalStorage = decoded.EnableAnalyticalStorage + s.EnableAutomaticFailover = decoded.EnableAutomaticFailover + s.EnableCassandraConnector = decoded.EnableCassandraConnector + s.EnableFreeTier = decoded.EnableFreeTier + s.EnableMultipleWriteLocations = decoded.EnableMultipleWriteLocations + s.EnablePartitionMerge = decoded.EnablePartitionMerge + s.FailoverPolicies = decoded.FailoverPolicies + s.IPRules = decoded.IPRules + s.InstanceId = decoded.InstanceId + s.IsVirtualNetworkFilterEnabled = decoded.IsVirtualNetworkFilterEnabled + s.KeyVaultKeyUri = decoded.KeyVaultKeyUri + s.KeysMetadata = decoded.KeysMetadata + s.Locations = decoded.Locations + s.MinimalTlsVersion = decoded.MinimalTlsVersion + s.NetworkAclBypass = decoded.NetworkAclBypass + s.NetworkAclBypassResourceIds = decoded.NetworkAclBypassResourceIds + s.PrivateEndpointConnections = decoded.PrivateEndpointConnections + s.ProvisioningState = decoded.ProvisioningState + s.PublicNetworkAccess = decoded.PublicNetworkAccess + s.ReadLocations = decoded.ReadLocations + s.RestoreParameters = decoded.RestoreParameters + s.VirtualNetworkRules = decoded.VirtualNetworkRules + s.WriteLocations = decoded.WriteLocations + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DatabaseAccountGetProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["backupPolicy"]; ok { + impl, err := unmarshalBackupPolicyImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'BackupPolicy' for 'DatabaseAccountGetProperties': %+v", err) + } + s.BackupPolicy = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetresults.go new file mode 100644 index 000000000000..666282032546 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountgetresults.go @@ -0,0 +1,21 @@ +package cosmosdb + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountGetResults struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Kind *DatabaseAccountKind `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DatabaseAccountGetProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountkeysmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountkeysmetadata.go new file mode 100644 index 000000000000..6c27837aef61 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountkeysmetadata.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountKeysMetadata struct { + PrimaryMasterKey *AccountKeyMetadata `json:"primaryMasterKey,omitempty"` + PrimaryReadonlyMasterKey *AccountKeyMetadata `json:"primaryReadonlyMasterKey,omitempty"` + SecondaryMasterKey *AccountKeyMetadata `json:"secondaryMasterKey,omitempty"` + SecondaryReadonlyMasterKey *AccountKeyMetadata `json:"secondaryReadonlyMasterKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistconnectionstringsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistconnectionstringsresult.go new file mode 100644 index 000000000000..2d12a4bf115c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistconnectionstringsresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountListConnectionStringsResult struct { + ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistkeysresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistkeysresult.go new file mode 100644 index 000000000000..0b5791f5e82e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistkeysresult.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountListKeysResult struct { + PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistreadonlykeysresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistreadonlykeysresult.go new file mode 100644 index 000000000000..94449f23b731 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountlistreadonlykeysresult.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountListReadOnlyKeysResult struct { + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountregeneratekeyparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountregeneratekeyparameters.go new file mode 100644 index 000000000000..24127f1ebf5f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountregeneratekeyparameters.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountRegenerateKeyParameters struct { + KeyKind KeyKind `json:"keyKind"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountslistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountslistresult.go new file mode 100644 index 000000000000..3ebc1f95822a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountslistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountsListResult struct { + Value *[]DatabaseAccountGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateparameters.go new file mode 100644 index 000000000000..490983c3a362 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateparameters.go @@ -0,0 +1,15 @@ +package cosmosdb + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountUpdateParameters struct { + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Properties *DatabaseAccountUpdateProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateproperties.go new file mode 100644 index 000000000000..9cc963368f4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaseaccountupdateproperties.go @@ -0,0 +1,90 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseAccountUpdateProperties struct { + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + ApiProperties *ApiProperties `json:"apiProperties,omitempty"` + BackupPolicy BackupPolicy `json:"backupPolicy"` + Capabilities *[]Capability `json:"capabilities,omitempty"` + Capacity *Capacity `json:"capacity,omitempty"` + ConnectorOffer *ConnectorOffer `json:"connectorOffer,omitempty"` + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + Cors *[]CorsPolicy `json:"cors,omitempty"` + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"` + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` + Locations *[]Location `json:"locations,omitempty"` + MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"` + NetworkAclBypass *NetworkAclBypass `json:"networkAclBypass,omitempty"` + NetworkAclBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` +} + +var _ json.Unmarshaler = &DatabaseAccountUpdateProperties{} + +func (s *DatabaseAccountUpdateProperties) UnmarshalJSON(bytes []byte) error { + type alias DatabaseAccountUpdateProperties + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into DatabaseAccountUpdateProperties: %+v", err) + } + + s.AnalyticalStorageConfiguration = decoded.AnalyticalStorageConfiguration + s.ApiProperties = decoded.ApiProperties + s.Capabilities = decoded.Capabilities + s.Capacity = decoded.Capacity + s.ConnectorOffer = decoded.ConnectorOffer + s.ConsistencyPolicy = decoded.ConsistencyPolicy + s.Cors = decoded.Cors + s.DefaultIdentity = decoded.DefaultIdentity + s.DisableKeyBasedMetadataWriteAccess = decoded.DisableKeyBasedMetadataWriteAccess + s.DisableLocalAuth = decoded.DisableLocalAuth + s.EnableAnalyticalStorage = decoded.EnableAnalyticalStorage + s.EnableAutomaticFailover = decoded.EnableAutomaticFailover + s.EnableCassandraConnector = decoded.EnableCassandraConnector + s.EnableFreeTier = decoded.EnableFreeTier + s.EnableMultipleWriteLocations = decoded.EnableMultipleWriteLocations + s.EnablePartitionMerge = decoded.EnablePartitionMerge + s.IPRules = decoded.IPRules + s.IsVirtualNetworkFilterEnabled = decoded.IsVirtualNetworkFilterEnabled + s.KeyVaultKeyUri = decoded.KeyVaultKeyUri + s.KeysMetadata = decoded.KeysMetadata + s.Locations = decoded.Locations + s.MinimalTlsVersion = decoded.MinimalTlsVersion + s.NetworkAclBypass = decoded.NetworkAclBypass + s.NetworkAclBypassResourceIds = decoded.NetworkAclBypassResourceIds + s.PublicNetworkAccess = decoded.PublicNetworkAccess + s.VirtualNetworkRules = decoded.VirtualNetworkRules + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DatabaseAccountUpdateProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["backupPolicy"]; ok { + impl, err := unmarshalBackupPolicyImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'BackupPolicy' for 'DatabaseAccountUpdateProperties': %+v", err) + } + s.BackupPolicy = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaserestoreresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaserestoreresource.go new file mode 100644 index 000000000000..dbd1f8d8ae2b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_databaserestoreresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseRestoreResource struct { + CollectionNames *[]string `json:"collectionNames,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_excludedpath.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_excludedpath.go new file mode 100644 index 000000000000..bde95e9be55e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_excludedpath.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExcludedPath struct { + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicies.go new file mode 100644 index 000000000000..74ed3bdeb214 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicies.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FailoverPolicies struct { + FailoverPolicies []FailoverPolicy `json:"failoverPolicies"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicy.go new file mode 100644 index 000000000000..097c14580fdc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_failoverpolicy.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FailoverPolicy struct { + FailoverPriority *int64 `json:"failoverPriority,omitempty"` + Id *string `json:"id,omitempty"` + LocationName *string `json:"locationName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateparameters.go new file mode 100644 index 000000000000..c231e4cc38f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties GremlinDatabaseCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateproperties.go new file mode 100644 index 000000000000..8c73f95990d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource GremlinDatabaseResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetproperties.go new file mode 100644 index 000000000000..e9fe3997923f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *GremlinDatabaseGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetresults.go new file mode 100644 index 000000000000..697b3fa2c47f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabasegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *GremlinDatabaseGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaselistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaselistresult.go new file mode 100644 index 000000000000..6cfabd66c63e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaselistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseListResult struct { + Value *[]GremlinDatabaseGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaseresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaseresource.go new file mode 100644 index 000000000000..d6f8be752423 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaseresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseResource struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaserestoreresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaserestoreresource.go new file mode 100644 index 000000000000..78d1f64828be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlindatabaserestoreresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinDatabaseRestoreResource struct { + DatabaseName *string `json:"databaseName,omitempty"` + GraphNames *[]string `json:"graphNames,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateparameters.go new file mode 100644 index 000000000000..21a8cf395296 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties GremlinGraphCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateproperties.go new file mode 100644 index 000000000000..c0523a35b18f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphcreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource GremlinGraphResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetproperties.go new file mode 100644 index 000000000000..5cb29c0c513d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *GremlinGraphGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetresults.go new file mode 100644 index 000000000000..fb47954496dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphgetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *GremlinGraphGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphlistresult.go new file mode 100644 index 000000000000..596577d1c377 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphListResult struct { + Value *[]GremlinGraphGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphresource.go new file mode 100644 index 000000000000..e2065cadd6e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_gremlingraphresource.go @@ -0,0 +1,14 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GremlinGraphResource struct { + AnalyticalStorageTtl *int64 `json:"analyticalStorageTtl,omitempty"` + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + DefaultTtl *int64 `json:"defaultTtl,omitempty"` + Id string `json:"id"` + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_includedpath.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_includedpath.go new file mode 100644 index 000000000000..fabdeb9057f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_includedpath.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IncludedPath struct { + Indexes *[]Indexes `json:"indexes,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexes.go new file mode 100644 index 000000000000..c9329116817b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexes.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Indexes struct { + DataType *DataType `json:"dataType,omitempty"` + Kind *IndexKind `json:"kind,omitempty"` + Precision *int64 `json:"precision,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexingpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexingpolicy.go new file mode 100644 index 000000000000..f4a6a5284aa8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_indexingpolicy.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IndexingPolicy struct { + Automatic *bool `json:"automatic,omitempty"` + CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"` + ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"` + IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"` + IndexingMode *IndexingMode `json:"indexingMode,omitempty"` + SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_ipaddressorrange.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_ipaddressorrange.go new file mode 100644 index 000000000000..d98bf6d3d73f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_ipaddressorrange.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPAddressOrRange struct { + IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_keywrapmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_keywrapmetadata.go new file mode 100644 index 000000000000..1bf8dd8076c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_keywrapmetadata.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyWrapMetadata struct { + Algorithm *string `json:"algorithm,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_location.go new file mode 100644 index 000000000000..88037b00dc79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_location.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Location struct { + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + FailoverPriority *int64 `json:"failoverPriority,omitempty"` + Id *string `json:"id,omitempty"` + IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"` + LocationName *string `json:"locationName,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationgetresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationgetresult.go new file mode 100644 index 000000000000..fcfc7e8f075e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationgetresult.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LocationGetResult struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *LocationProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationlistresult.go new file mode 100644 index 000000000000..91b00e280146 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LocationListResult struct { + Value *[]LocationGetResult `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationproperties.go new file mode 100644 index 000000000000..8be53e94749c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_locationproperties.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LocationProperties struct { + BackupStorageRedundancies *[]BackupStorageRedundancy `json:"backupStorageRedundancies,omitempty"` + IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty"` + SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metric.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metric.go new file mode 100644 index 000000000000..86519de0a645 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metric.go @@ -0,0 +1,43 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Metric struct { + EndTime *string `json:"endTime,omitempty"` + MetricValues *[]MetricValue `json:"metricValues,omitempty"` + Name *MetricName `json:"name,omitempty"` + StartTime *string `json:"startTime,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} + +func (o *Metric) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *Metric) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *Metric) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *Metric) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricavailability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricavailability.go new file mode 100644 index 000000000000..eb8fb801ac82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricavailability.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricAvailability struct { + Retention *string `json:"retention,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinition.go new file mode 100644 index 000000000000..cc6ee5b2df0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinition.go @@ -0,0 +1,12 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricDefinition struct { + MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` + Name *MetricName `json:"name,omitempty"` + PrimaryAggregationType *PrimaryAggregationType `json:"primaryAggregationType,omitempty"` + ResourceUri *string `json:"resourceUri,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinitionslistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinitionslistresult.go new file mode 100644 index 000000000000..8e95145ff465 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricdefinitionslistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricDefinitionsListResult struct { + Value *[]MetricDefinition `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metriclistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metriclistresult.go new file mode 100644 index 000000000000..2adeed3a1228 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metriclistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricListResult struct { + Value *[]Metric `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricname.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricname.go new file mode 100644 index 000000000000..4b4b6b6bf68b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricname.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricName struct { + LocalizedValue *string `json:"localizedValue,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricvalue.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricvalue.go new file mode 100644 index 000000000000..e1daf9ac54c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_metricvalue.go @@ -0,0 +1,31 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MetricValue struct { + Average *float64 `json:"average,omitempty"` + Count *float64 `json:"_count,omitempty"` + Maximum *float64 `json:"maximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Total *float64 `json:"total,omitempty"` +} + +func (o *MetricValue) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MetricValue) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateparameters.go new file mode 100644 index 000000000000..2cc7d6a6c21e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties MongoDBCollectionCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateproperties.go new file mode 100644 index 000000000000..94b9078b9450 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectioncreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource MongoDBCollectionResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetproperties.go new file mode 100644 index 000000000000..46e2c9b2c709 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *MongoDBCollectionGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetresults.go new file mode 100644 index 000000000000..1e010f172d87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectiongetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MongoDBCollectionGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionlistresult.go new file mode 100644 index 000000000000..ff9a2992f7ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionListResult struct { + Value *[]MongoDBCollectionGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionresource.go new file mode 100644 index 000000000000..85e7d822c268 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbcollectionresource.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBCollectionResource struct { + AnalyticalStorageTtl *int64 `json:"analyticalStorageTtl,omitempty"` + Id string `json:"id"` + Indexes *[]MongoIndex `json:"indexes,omitempty"` + ShardKey *map[string]string `json:"shardKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateparameters.go new file mode 100644 index 000000000000..39f29eca06a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties MongoDBDatabaseCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateproperties.go new file mode 100644 index 000000000000..e2742259aad7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource MongoDBDatabaseResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetproperties.go new file mode 100644 index 000000000000..78e44e8a8c0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *MongoDBDatabaseGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetresults.go new file mode 100644 index 000000000000..a46ab4a9340d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabasegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MongoDBDatabaseGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaselistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaselistresult.go new file mode 100644 index 000000000000..bd2d989ab0ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaselistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseListResult struct { + Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaseresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaseresource.go new file mode 100644 index 000000000000..10c01189284f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongodbdatabaseresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBDatabaseResource struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindex.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindex.go new file mode 100644 index 000000000000..a6107d1601ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindex.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoIndex struct { + Key *MongoIndexKeys `json:"key,omitempty"` + Options *MongoIndexOptions `json:"options,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexkeys.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexkeys.go new file mode 100644 index 000000000000..a86dd3accb1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexkeys.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoIndexKeys struct { + Keys *[]string `json:"keys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexoptions.go new file mode 100644 index 000000000000..1a1d7b4d8ee2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_mongoindexoptions.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoIndexOptions struct { + ExpireAfterSeconds *int64 `json:"expireAfterSeconds,omitempty"` + Unique *bool `json:"unique,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_optionsresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_optionsresource.go new file mode 100644 index 000000000000..59afcc42242a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_optionsresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OptionsResource struct { + AutoScaleSettings *AutoScaleSettings `json:"autoscaleSettings,omitempty"` + Throughput *int64 `json:"throughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetric.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetric.go new file mode 100644 index 000000000000..e1f09dcd6e47 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetric.go @@ -0,0 +1,45 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionMetric struct { + EndTime *string `json:"endTime,omitempty"` + MetricValues *[]MetricValue `json:"metricValues,omitempty"` + Name *MetricName `json:"name,omitempty"` + PartitionId *string `json:"partitionId,omitempty"` + PartitionKeyRangeId *string `json:"partitionKeyRangeId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} + +func (o *PartitionMetric) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *PartitionMetric) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *PartitionMetric) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *PartitionMetric) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetriclistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetriclistresult.go new file mode 100644 index 000000000000..201be59ac641 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionmetriclistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionMetricListResult struct { + Value *[]PartitionMetric `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusage.go new file mode 100644 index 000000000000..a480ca1758fc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusage.go @@ -0,0 +1,14 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionUsage struct { + CurrentValue *int64 `json:"currentValue,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Name *MetricName `json:"name,omitempty"` + PartitionId *string `json:"partitionId,omitempty"` + PartitionKeyRangeId *string `json:"partitionKeyRangeId,omitempty"` + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusagesresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusagesresult.go new file mode 100644 index 000000000000..6d9d8fcb080f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_partitionusagesresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PartitionUsagesResult struct { + Value *[]PartitionUsage `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetric.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetric.go new file mode 100644 index 000000000000..3970d324e536 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetric.go @@ -0,0 +1,43 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileMetric struct { + EndTime *string `json:"endTime,omitempty"` + MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` + Name *MetricName `json:"name,omitempty"` + StartTime *string `json:"startTime,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} + +func (o *PercentileMetric) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *PercentileMetric) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *PercentileMetric) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *PercentileMetric) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetriclistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetriclistresult.go new file mode 100644 index 000000000000..29162dadfc91 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetriclistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileMetricListResult struct { + Value *[]PercentileMetric `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetricvalue.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetricvalue.go new file mode 100644 index 000000000000..38c6ab31142e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_percentilemetricvalue.go @@ -0,0 +1,38 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PercentileMetricValue struct { + Average *float64 `json:"average,omitempty"` + Count *float64 `json:"_count,omitempty"` + Maximum *float64 `json:"maximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + P10 *float64 `json:"P10,omitempty"` + P25 *float64 `json:"P25,omitempty"` + P50 *float64 `json:"P50,omitempty"` + P75 *float64 `json:"P75,omitempty"` + P90 *float64 `json:"P90,omitempty"` + P95 *float64 `json:"P95,omitempty"` + P99 *float64 `json:"P99,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Total *float64 `json:"total,omitempty"` +} + +func (o *PercentileMetricValue) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *PercentileMetricValue) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodebackuppolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodebackuppolicy.go new file mode 100644 index 000000000000..b3d0a4a335cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodebackuppolicy.go @@ -0,0 +1,42 @@ +package cosmosdb + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ BackupPolicy = PeriodicModeBackupPolicy{} + +type PeriodicModeBackupPolicy struct { + PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"` + + // Fields inherited from BackupPolicy + MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` +} + +var _ json.Marshaler = PeriodicModeBackupPolicy{} + +func (s PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { + type wrapper PeriodicModeBackupPolicy + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PeriodicModeBackupPolicy: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PeriodicModeBackupPolicy: %+v", err) + } + decoded["type"] = "Periodic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PeriodicModeBackupPolicy: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodeproperties.go new file mode 100644 index 000000000000..91556dc1a2c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_periodicmodeproperties.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeriodicModeProperties struct { + BackupIntervalInMinutes *int64 `json:"backupIntervalInMinutes,omitempty"` + BackupRetentionIntervalInHours *int64 `json:"backupRetentionIntervalInHours,omitempty"` + BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnection.go new file mode 100644 index 000000000000..252869eaec24 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnection.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnectionproperties.go new file mode 100644 index 000000000000..ce1d70df3e5a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + GroupId *string `json:"groupId,omitempty"` + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointproperty.go new file mode 100644 index 000000000000..19db84013f4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privateendpointproperty.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointProperty struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privatelinkserviceconnectionstateproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privatelinkserviceconnectionstateproperty.go new file mode 100644 index 000000000000..06265a92fb40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_privatelinkserviceconnectionstateproperty.go @@ -0,0 +1,10 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionStateProperty struct { + ActionsRequired *string `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_regionforonlineoffline.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_regionforonlineoffline.go new file mode 100644 index 000000000000..8ccb60efd234 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_regionforonlineoffline.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegionForOnlineOffline struct { + Region string `json:"region"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_restoreparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_restoreparameters.go new file mode 100644 index 000000000000..84373f463d7b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_restoreparameters.go @@ -0,0 +1,31 @@ +package cosmosdb + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestoreParameters struct { + DatabasesToRestore *[]DatabaseRestoreResource `json:"databasesToRestore,omitempty"` + GremlinDatabasesToRestore *[]GremlinDatabaseRestoreResource `json:"gremlinDatabasesToRestore,omitempty"` + RestoreMode *RestoreMode `json:"restoreMode,omitempty"` + RestoreSource *string `json:"restoreSource,omitempty"` + RestoreTimestampInUtc *string `json:"restoreTimestampInUtc,omitempty"` + TablesToRestore *[]string `json:"tablesToRestore,omitempty"` +} + +func (o *RestoreParameters) GetRestoreTimestampInUtcAsTime() (*time.Time, error) { + if o.RestoreTimestampInUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.RestoreTimestampInUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *RestoreParameters) SetRestoreTimestampInUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.RestoreTimestampInUtc = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_spatialspec.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_spatialspec.go new file mode 100644 index 000000000000..4282f14daf79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_spatialspec.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SpatialSpec struct { + Path *string `json:"path,omitempty"` + Types *[]SpatialType `json:"types,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateparameters.go new file mode 100644 index 000000000000..ca6834e6723c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties SqlContainerCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateproperties.go new file mode 100644 index 000000000000..cc551c2ee195 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainercreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource SqlContainerResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetproperties.go new file mode 100644 index 000000000000..fa0d17966a90 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *SqlContainerGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetresults.go new file mode 100644 index 000000000000..59cde614180a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainergetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlContainerGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerlistresult.go new file mode 100644 index 000000000000..0536cfcc0c6f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerListResult struct { + Value *[]SqlContainerGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerresource.go new file mode 100644 index 000000000000..e3d740796d5d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlcontainerresource.go @@ -0,0 +1,15 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlContainerResource struct { + AnalyticalStorageTtl *int64 `json:"analyticalStorageTtl,omitempty"` + ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + DefaultTtl *int64 `json:"defaultTtl,omitempty"` + Id string `json:"id"` + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateparameters.go new file mode 100644 index 000000000000..050d7c20bb2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties SqlDatabaseCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateproperties.go new file mode 100644 index 000000000000..902885b9b944 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource SqlDatabaseResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetproperties.go new file mode 100644 index 000000000000..861bd784b772 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *SqlDatabaseGetPropertiesResource `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetpropertiesresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetpropertiesresource.go new file mode 100644 index 000000000000..55917fc2b456 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetpropertiesresource.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseGetPropertiesResource struct { + Colls *string `json:"_colls,omitempty"` + Etag *string `json:"_etag,omitempty"` + Id *string `json:"id,omitempty"` + Rid *string `json:"_rid,omitempty"` + Ts *float64 `json:"_ts,omitempty"` + Users *string `json:"_users,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetresults.go new file mode 100644 index 000000000000..c78964be9116 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabasegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlDatabaseGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaselistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaselistresult.go new file mode 100644 index 000000000000..f8f3a703ab36 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaselistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseListResult struct { + Value *[]SqlDatabaseGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaseresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaseresource.go new file mode 100644 index 000000000000..3587c9d221e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqldatabaseresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlDatabaseResource struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateparameters.go new file mode 100644 index 000000000000..6aed32d28c60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties SqlStoredProcedureCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateproperties.go new file mode 100644 index 000000000000..37150ea7e53c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource SqlStoredProcedureResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetproperties.go new file mode 100644 index 000000000000..6f511f0e87d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureGetProperties struct { + Resource *SqlStoredProcedureGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetresults.go new file mode 100644 index 000000000000..c5d8553b895a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredproceduregetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlStoredProcedureGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurelistresult.go new file mode 100644 index 000000000000..07aaff40a2b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedurelistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureListResult struct { + Value *[]SqlStoredProcedureGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedureresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedureresource.go new file mode 100644 index 000000000000..182425cfbed7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqlstoredprocedureresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlStoredProcedureResource struct { + Body *string `json:"body,omitempty"` + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateparameters.go new file mode 100644 index 000000000000..6ab4b680a2f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties SqlTriggerCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateproperties.go new file mode 100644 index 000000000000..ca1c76fb5579 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggercreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource SqlTriggerResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetproperties.go new file mode 100644 index 000000000000..ba7399fbd1cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerGetProperties struct { + Resource *SqlTriggerGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetresults.go new file mode 100644 index 000000000000..4dc14101cdeb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggergetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlTriggerGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerlistresult.go new file mode 100644 index 000000000000..671102647375 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerListResult struct { + Value *[]SqlTriggerGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerresource.go new file mode 100644 index 000000000000..bfa993fb9646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqltriggerresource.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlTriggerResource struct { + Body *string `json:"body,omitempty"` + Id string `json:"id"` + TriggerOperation *TriggerOperation `json:"triggerOperation,omitempty"` + TriggerType *TriggerType `json:"triggerType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateparameters.go new file mode 100644 index 000000000000..77d5e85941dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties SqlUserDefinedFunctionCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateproperties.go new file mode 100644 index 000000000000..c1948c08d65d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctioncreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource SqlUserDefinedFunctionResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetproperties.go new file mode 100644 index 000000000000..b9a099c337c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionGetProperties struct { + Resource *SqlUserDefinedFunctionGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetresults.go new file mode 100644 index 000000000000..8ac972d5508d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctiongetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlUserDefinedFunctionGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionlistresult.go new file mode 100644 index 000000000000..561cc720c2d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionlistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionListResult struct { + Value *[]SqlUserDefinedFunctionGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionresource.go new file mode 100644 index 000000000000..5cd0ae1bc748 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_sqluserdefinedfunctionresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlUserDefinedFunctionResource struct { + Body *string `json:"body,omitempty"` + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateparameters.go new file mode 100644 index 000000000000..e65573f60ba3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableCreateUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties TableCreateUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateproperties.go new file mode 100644 index 000000000000..00b71f7cefaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablecreateupdateproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableCreateUpdateProperties struct { + Options *CreateUpdateOptions `json:"options,omitempty"` + Resource TableResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetproperties.go new file mode 100644 index 000000000000..4ccd4846c2c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetproperties.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableGetProperties struct { + Options *OptionsResource `json:"options,omitempty"` + Resource *TableGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetresults.go new file mode 100644 index 000000000000..cd4ad22cc805 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablegetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *TableGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablelistresult.go new file mode 100644 index 000000000000..77b9bc4edea4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tablelistresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableListResult struct { + Value *[]TableGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tableresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tableresource.go new file mode 100644 index 000000000000..c8db3cb1be82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_tableresource.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TableResource struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputpolicyresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputpolicyresource.go new file mode 100644 index 000000000000..12cae27f8715 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputpolicyresource.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputPolicyResource struct { + IncrementPercent *int64 `json:"incrementPercent,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetproperties.go new file mode 100644 index 000000000000..08fb9e1e60ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputSettingsGetProperties struct { + Resource *ThroughputSettingsGetProperties `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetresults.go new file mode 100644 index 000000000000..2185d88dc057 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsgetresults.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputSettingsGetResults struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ThroughputSettingsGetProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsresource.go new file mode 100644 index 000000000000..edfe32789725 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsresource.go @@ -0,0 +1,11 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputSettingsResource struct { + AutoScaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` + MinimumThroughput *string `json:"minimumThroughput,omitempty"` + OfferReplacePending *string `json:"offerReplacePending,omitempty"` + Throughput *int64 `json:"throughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateparameters.go new file mode 100644 index 000000000000..a21087a29443 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateparameters.go @@ -0,0 +1,13 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputSettingsUpdateParameters struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties ThroughputSettingsUpdateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateproperties.go new file mode 100644 index 000000000000..4dd2779427ac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_throughputsettingsupdateproperties.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThroughputSettingsUpdateProperties struct { + Resource ThroughputSettingsResource `json:"resource"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekey.go new file mode 100644 index 000000000000..5339c8755c43 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekey.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UniqueKey struct { + Paths *[]string `json:"paths,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekeypolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekeypolicy.go new file mode 100644 index 000000000000..3f5cd2d0e93a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_uniquekeypolicy.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UniqueKeyPolicy struct { + UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usage.go new file mode 100644 index 000000000000..dd97540fb2f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usage.go @@ -0,0 +1,12 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Usage struct { + CurrentValue *int64 `json:"currentValue,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Name *MetricName `json:"name,omitempty"` + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + Unit *UnitType `json:"unit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usagesresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usagesresult.go new file mode 100644 index 000000000000..dcb0c10e3331 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_usagesresult.go @@ -0,0 +1,8 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UsagesResult struct { + Value *[]Usage `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_virtualnetworkrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_virtualnetworkrule.go new file mode 100644 index 000000000000..7f767ef737b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/model_virtualnetworkrule.go @@ -0,0 +1,9 @@ +package cosmosdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkRule struct { + Id *string `json:"id,omitempty"` + IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/version.go new file mode 100644 index 000000000000..60a20461c634 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb/version.go @@ -0,0 +1,12 @@ +package cosmosdb + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-15" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/cosmosdb/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md new file mode 100644 index 000000000000..90154513b098 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md @@ -0,0 +1,142 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs` Documentation + +The `mongorbacs` SDK allows for interaction with the Azure Resource Manager Service `cosmosdb` (API Version `2022-11-15`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" +``` + + +### Client Initialization + +```go +client := mongorbacs.NewMongorbacsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesCreateUpdateMongoRoleDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoRoleDefinitionIdValue") + +payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesCreateUpdateMongoUserDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoUserDefinitionIdValue") + +payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ + // ... +} + + +if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesDeleteMongoRoleDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoRoleDefinitionIdValue") + +if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesDeleteMongoUserDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoUserDefinitionIdValue") + +if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesGetMongoRoleDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoRoleDefinitionIdValue") + +read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesGetMongoUserDefinition` + +```go +ctx := context.TODO() +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "mongoUserDefinitionIdValue") + +read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesListMongoRoleDefinitions` + +```go +ctx := context.TODO() +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MongorbacsClient.MongoDBResourcesListMongoUserDefinitions` + +```go +ctx := context.TODO() +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue") + +read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/client.go new file mode 100644 index 000000000000..7e7c3040b504 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/client.go @@ -0,0 +1,18 @@ +package mongorbacs + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongorbacsClient struct { + Client autorest.Client + baseUri string +} + +func NewMongorbacsClientWithBaseURI(endpoint string) MongorbacsClient { + return MongorbacsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go new file mode 100644 index 000000000000..2ce71f91c91b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go @@ -0,0 +1,34 @@ +package mongorbacs + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoRoleDefinitionType string + +const ( + MongoRoleDefinitionTypeBuiltInRole MongoRoleDefinitionType = "BuiltInRole" + MongoRoleDefinitionTypeCustomRole MongoRoleDefinitionType = "CustomRole" +) + +func PossibleValuesForMongoRoleDefinitionType() []string { + return []string{ + string(MongoRoleDefinitionTypeBuiltInRole), + string(MongoRoleDefinitionTypeCustomRole), + } +} + +func parseMongoRoleDefinitionType(input string) (*MongoRoleDefinitionType, error) { + vals := map[string]MongoRoleDefinitionType{ + "builtinrole": MongoRoleDefinitionTypeBuiltInRole, + "customrole": MongoRoleDefinitionTypeCustomRole, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoRoleDefinitionType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go new file mode 100644 index 000000000000..e8d13a2bbbac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go @@ -0,0 +1,127 @@ +package mongorbacs + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = DatabaseAccountId{} + +// DatabaseAccountId is a struct representing the Resource ID for a Database Account +type DatabaseAccountId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string +} + +// NewDatabaseAccountID returns a new DatabaseAccountId struct +func NewDatabaseAccountID(subscriptionId string, resourceGroupName string, databaseAccountName string) DatabaseAccountId { + return DatabaseAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + } +} + +// ParseDatabaseAccountID parses 'input' into a DatabaseAccountId +func ParseDatabaseAccountID(input string) (*DatabaseAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseAccountIDInsensitively parses 'input' case-insensitively into a DatabaseAccountId +// note: this method should only be used for API response data and not user input +func ParseDatabaseAccountIDInsensitively(input string) (*DatabaseAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseAccountID checks that 'input' can be parsed as a Database Account ID +func ValidateDatabaseAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Account ID +func (id DatabaseAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Account ID +func (id DatabaseAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + } +} + +// String returns a human-readable description of this Database Account ID +func (id DatabaseAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + } + return fmt.Sprintf("Database Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go new file mode 100644 index 000000000000..f6646312c834 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go @@ -0,0 +1,140 @@ +package mongorbacs + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = MongodbRoleDefinitionId{} + +// MongodbRoleDefinitionId is a struct representing the Resource ID for a Mongodb Role Definition +type MongodbRoleDefinitionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + MongoRoleDefinitionId string +} + +// NewMongodbRoleDefinitionID returns a new MongodbRoleDefinitionId struct +func NewMongodbRoleDefinitionID(subscriptionId string, resourceGroupName string, databaseAccountName string, mongoRoleDefinitionId string) MongodbRoleDefinitionId { + return MongodbRoleDefinitionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + MongoRoleDefinitionId: mongoRoleDefinitionId, + } +} + +// ParseMongodbRoleDefinitionID parses 'input' into a MongodbRoleDefinitionId +func ParseMongodbRoleDefinitionID(input string) (*MongodbRoleDefinitionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbRoleDefinitionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbRoleDefinitionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongoRoleDefinitionId, ok = parsed.Parsed["mongoRoleDefinitionId"]; !ok { + return nil, fmt.Errorf("the segment 'mongoRoleDefinitionId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseMongodbRoleDefinitionIDInsensitively parses 'input' case-insensitively into a MongodbRoleDefinitionId +// note: this method should only be used for API response data and not user input +func ParseMongodbRoleDefinitionIDInsensitively(input string) (*MongodbRoleDefinitionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbRoleDefinitionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbRoleDefinitionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongoRoleDefinitionId, ok = parsed.Parsed["mongoRoleDefinitionId"]; !ok { + return nil, fmt.Errorf("the segment 'mongoRoleDefinitionId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateMongodbRoleDefinitionID checks that 'input' can be parsed as a Mongodb Role Definition ID +func ValidateMongodbRoleDefinitionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMongodbRoleDefinitionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mongodb Role Definition ID +func (id MongodbRoleDefinitionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/mongodbRoleDefinitions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.MongoRoleDefinitionId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mongodb Role Definition ID +func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), + resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionIdValue"), + } +} + +// String returns a human-readable description of this Mongodb Role Definition ID +func (id MongodbRoleDefinitionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Mongo Role Definition: %q", id.MongoRoleDefinitionId), + } + return fmt.Sprintf("Mongodb Role Definition (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go new file mode 100644 index 000000000000..6e82be3cc647 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go @@ -0,0 +1,140 @@ +package mongorbacs + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = MongodbUserDefinitionId{} + +// MongodbUserDefinitionId is a struct representing the Resource ID for a Mongodb User Definition +type MongodbUserDefinitionId struct { + SubscriptionId string + ResourceGroupName string + DatabaseAccountName string + MongoUserDefinitionId string +} + +// NewMongodbUserDefinitionID returns a new MongodbUserDefinitionId struct +func NewMongodbUserDefinitionID(subscriptionId string, resourceGroupName string, databaseAccountName string, mongoUserDefinitionId string) MongodbUserDefinitionId { + return MongodbUserDefinitionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DatabaseAccountName: databaseAccountName, + MongoUserDefinitionId: mongoUserDefinitionId, + } +} + +// ParseMongodbUserDefinitionID parses 'input' into a MongodbUserDefinitionId +func ParseMongodbUserDefinitionID(input string) (*MongodbUserDefinitionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbUserDefinitionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbUserDefinitionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongoUserDefinitionId, ok = parsed.Parsed["mongoUserDefinitionId"]; !ok { + return nil, fmt.Errorf("the segment 'mongoUserDefinitionId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseMongodbUserDefinitionIDInsensitively parses 'input' case-insensitively into a MongodbUserDefinitionId +// note: this method should only be used for API response data and not user input +func ParseMongodbUserDefinitionIDInsensitively(input string) (*MongodbUserDefinitionId, error) { + parser := resourceids.NewParserFromResourceIdType(MongodbUserDefinitionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := MongodbUserDefinitionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + } + + if id.MongoUserDefinitionId, ok = parsed.Parsed["mongoUserDefinitionId"]; !ok { + return nil, fmt.Errorf("the segment 'mongoUserDefinitionId' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateMongodbUserDefinitionID checks that 'input' can be parsed as a Mongodb User Definition ID +func ValidateMongodbUserDefinitionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMongodbUserDefinitionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mongodb User Definition ID +func (id MongodbUserDefinitionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s/mongodbUserDefinitions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, id.MongoUserDefinitionId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mongodb User Definition ID +func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), + resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountValue"), + resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), + resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionIdValue"), + } +} + +// String returns a human-readable description of this Mongodb User Definition ID +func (id MongodbUserDefinitionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Database Account Name: %q", id.DatabaseAccountName), + fmt.Sprintf("Mongo User Definition: %q", id.MongoUserDefinitionId), + } + return fmt.Sprintf("Mongodb User Definition (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongoroledefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongoroledefinition_autorest.go new file mode 100644 index 000000000000..84ce8a2f9ccf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongoroledefinition_autorest.go @@ -0,0 +1,79 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesCreateUpdateMongoRoleDefinitionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesCreateUpdateMongoRoleDefinition ... +func (c MongorbacsClient) MongoDBResourcesCreateUpdateMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId, input MongoRoleDefinitionCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoRoleDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesCreateUpdateMongoRoleDefinition(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesCreateUpdateMongoRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesCreateUpdateMongoRoleDefinition(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesCreateUpdateMongoRoleDefinition", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll performs MongoDBResourcesCreateUpdateMongoRoleDefinition then polls until it's completed +func (c MongorbacsClient) MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx context.Context, id MongodbRoleDefinitionId, input MongoRoleDefinitionCreateUpdateParameters) error { + result, err := c.MongoDBResourcesCreateUpdateMongoRoleDefinition(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesCreateUpdateMongoRoleDefinition: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesCreateUpdateMongoRoleDefinition: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesCreateUpdateMongoRoleDefinition prepares the MongoDBResourcesCreateUpdateMongoRoleDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesCreateUpdateMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId, input MongoRoleDefinitionCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesCreateUpdateMongoRoleDefinition sends the MongoDBResourcesCreateUpdateMongoRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (c MongorbacsClient) senderForMongoDBResourcesCreateUpdateMongoRoleDefinition(ctx context.Context, req *http.Request) (future MongoDBResourcesCreateUpdateMongoRoleDefinitionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongouserdefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongouserdefinition_autorest.go new file mode 100644 index 000000000000..1f4729b2071c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcescreateupdatemongouserdefinition_autorest.go @@ -0,0 +1,79 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesCreateUpdateMongoUserDefinitionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesCreateUpdateMongoUserDefinition ... +func (c MongorbacsClient) MongoDBResourcesCreateUpdateMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId, input MongoUserDefinitionCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoUserDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesCreateUpdateMongoUserDefinition(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesCreateUpdateMongoUserDefinition", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesCreateUpdateMongoUserDefinition(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesCreateUpdateMongoUserDefinition", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll performs MongoDBResourcesCreateUpdateMongoUserDefinition then polls until it's completed +func (c MongorbacsClient) MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx context.Context, id MongodbUserDefinitionId, input MongoUserDefinitionCreateUpdateParameters) error { + result, err := c.MongoDBResourcesCreateUpdateMongoUserDefinition(ctx, id, input) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesCreateUpdateMongoUserDefinition: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesCreateUpdateMongoUserDefinition: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesCreateUpdateMongoUserDefinition prepares the MongoDBResourcesCreateUpdateMongoUserDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesCreateUpdateMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId, input MongoUserDefinitionCreateUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesCreateUpdateMongoUserDefinition sends the MongoDBResourcesCreateUpdateMongoUserDefinition request. The method will close the +// http.Response Body if it receives an error. +func (c MongorbacsClient) senderForMongoDBResourcesCreateUpdateMongoUserDefinition(ctx context.Context, req *http.Request) (future MongoDBResourcesCreateUpdateMongoUserDefinitionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongoroledefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongoroledefinition_autorest.go new file mode 100644 index 000000000000..956311ad851f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongoroledefinition_autorest.go @@ -0,0 +1,78 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesDeleteMongoRoleDefinitionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesDeleteMongoRoleDefinition ... +func (c MongorbacsClient) MongoDBResourcesDeleteMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId) (result MongoDBResourcesDeleteMongoRoleDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesDeleteMongoRoleDefinition(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesDeleteMongoRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesDeleteMongoRoleDefinition(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesDeleteMongoRoleDefinition", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesDeleteMongoRoleDefinitionThenPoll performs MongoDBResourcesDeleteMongoRoleDefinition then polls until it's completed +func (c MongorbacsClient) MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx context.Context, id MongodbRoleDefinitionId) error { + result, err := c.MongoDBResourcesDeleteMongoRoleDefinition(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesDeleteMongoRoleDefinition: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesDeleteMongoRoleDefinition: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesDeleteMongoRoleDefinition prepares the MongoDBResourcesDeleteMongoRoleDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesDeleteMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesDeleteMongoRoleDefinition sends the MongoDBResourcesDeleteMongoRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (c MongorbacsClient) senderForMongoDBResourcesDeleteMongoRoleDefinition(ctx context.Context, req *http.Request) (future MongoDBResourcesDeleteMongoRoleDefinitionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongouserdefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongouserdefinition_autorest.go new file mode 100644 index 000000000000..eb5f268a611c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesdeletemongouserdefinition_autorest.go @@ -0,0 +1,78 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesDeleteMongoUserDefinitionOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// MongoDBResourcesDeleteMongoUserDefinition ... +func (c MongorbacsClient) MongoDBResourcesDeleteMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId) (result MongoDBResourcesDeleteMongoUserDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesDeleteMongoUserDefinition(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesDeleteMongoUserDefinition", nil, "Failure preparing request") + return + } + + result, err = c.senderForMongoDBResourcesDeleteMongoUserDefinition(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesDeleteMongoUserDefinition", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// MongoDBResourcesDeleteMongoUserDefinitionThenPoll performs MongoDBResourcesDeleteMongoUserDefinition then polls until it's completed +func (c MongorbacsClient) MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx context.Context, id MongodbUserDefinitionId) error { + result, err := c.MongoDBResourcesDeleteMongoUserDefinition(ctx, id) + if err != nil { + return fmt.Errorf("performing MongoDBResourcesDeleteMongoUserDefinition: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after MongoDBResourcesDeleteMongoUserDefinition: %+v", err) + } + + return nil +} + +// preparerForMongoDBResourcesDeleteMongoUserDefinition prepares the MongoDBResourcesDeleteMongoUserDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesDeleteMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForMongoDBResourcesDeleteMongoUserDefinition sends the MongoDBResourcesDeleteMongoUserDefinition request. The method will close the +// http.Response Body if it receives an error. +func (c MongorbacsClient) senderForMongoDBResourcesDeleteMongoUserDefinition(ctx context.Context, req *http.Request) (future MongoDBResourcesDeleteMongoUserDefinitionOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongoroledefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongoroledefinition_autorest.go new file mode 100644 index 000000000000..466c01d1ba49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongoroledefinition_autorest.go @@ -0,0 +1,68 @@ +package mongorbacs + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoRoleDefinitionOperationResponse struct { + HttpResponse *http.Response + Model *MongoRoleDefinitionGetResults +} + +// MongoDBResourcesGetMongoRoleDefinition ... +func (c MongorbacsClient) MongoDBResourcesGetMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId) (result MongoDBResourcesGetMongoRoleDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoRoleDefinition(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoRoleDefinition", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoRoleDefinition", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoRoleDefinition(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoRoleDefinition", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoRoleDefinition prepares the MongoDBResourcesGetMongoRoleDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesGetMongoRoleDefinition(ctx context.Context, id MongodbRoleDefinitionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoRoleDefinition handles the response to the MongoDBResourcesGetMongoRoleDefinition request. The method always +// closes the http.Response Body. +func (c MongorbacsClient) responderForMongoDBResourcesGetMongoRoleDefinition(resp *http.Response) (result MongoDBResourcesGetMongoRoleDefinitionOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongouserdefinition_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongouserdefinition_autorest.go new file mode 100644 index 000000000000..400ca89e7433 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourcesgetmongouserdefinition_autorest.go @@ -0,0 +1,68 @@ +package mongorbacs + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesGetMongoUserDefinitionOperationResponse struct { + HttpResponse *http.Response + Model *MongoUserDefinitionGetResults +} + +// MongoDBResourcesGetMongoUserDefinition ... +func (c MongorbacsClient) MongoDBResourcesGetMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId) (result MongoDBResourcesGetMongoUserDefinitionOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesGetMongoUserDefinition(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoUserDefinition", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoUserDefinition", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesGetMongoUserDefinition(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesGetMongoUserDefinition", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesGetMongoUserDefinition prepares the MongoDBResourcesGetMongoUserDefinition request. +func (c MongorbacsClient) preparerForMongoDBResourcesGetMongoUserDefinition(ctx context.Context, id MongodbUserDefinitionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesGetMongoUserDefinition handles the response to the MongoDBResourcesGetMongoUserDefinition request. The method always +// closes the http.Response Body. +func (c MongorbacsClient) responderForMongoDBResourcesGetMongoUserDefinition(resp *http.Response) (result MongoDBResourcesGetMongoUserDefinitionOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongoroledefinitions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongoroledefinitions_autorest.go new file mode 100644 index 000000000000..6ea3af0c5de6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongoroledefinitions_autorest.go @@ -0,0 +1,69 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesListMongoRoleDefinitionsOperationResponse struct { + HttpResponse *http.Response + Model *MongoRoleDefinitionListResult +} + +// MongoDBResourcesListMongoRoleDefinitions ... +func (c MongorbacsClient) MongoDBResourcesListMongoRoleDefinitions(ctx context.Context, id DatabaseAccountId) (result MongoDBResourcesListMongoRoleDefinitionsOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesListMongoRoleDefinitions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoRoleDefinitions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoRoleDefinitions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesListMongoRoleDefinitions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoRoleDefinitions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesListMongoRoleDefinitions prepares the MongoDBResourcesListMongoRoleDefinitions request. +func (c MongorbacsClient) preparerForMongoDBResourcesListMongoRoleDefinitions(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/mongodbRoleDefinitions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesListMongoRoleDefinitions handles the response to the MongoDBResourcesListMongoRoleDefinitions request. The method always +// closes the http.Response Body. +func (c MongorbacsClient) responderForMongoDBResourcesListMongoRoleDefinitions(resp *http.Response) (result MongoDBResourcesListMongoRoleDefinitionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongouserdefinitions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongouserdefinitions_autorest.go new file mode 100644 index 000000000000..84d5ae257509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/method_mongodbresourceslistmongouserdefinitions_autorest.go @@ -0,0 +1,69 @@ +package mongorbacs + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDBResourcesListMongoUserDefinitionsOperationResponse struct { + HttpResponse *http.Response + Model *MongoUserDefinitionListResult +} + +// MongoDBResourcesListMongoUserDefinitions ... +func (c MongorbacsClient) MongoDBResourcesListMongoUserDefinitions(ctx context.Context, id DatabaseAccountId) (result MongoDBResourcesListMongoUserDefinitionsOperationResponse, err error) { + req, err := c.preparerForMongoDBResourcesListMongoUserDefinitions(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoUserDefinitions", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoUserDefinitions", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForMongoDBResourcesListMongoUserDefinitions(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "mongorbacs.MongorbacsClient", "MongoDBResourcesListMongoUserDefinitions", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForMongoDBResourcesListMongoUserDefinitions prepares the MongoDBResourcesListMongoUserDefinitions request. +func (c MongorbacsClient) preparerForMongoDBResourcesListMongoUserDefinitions(ctx context.Context, id DatabaseAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/mongodbUserDefinitions", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForMongoDBResourcesListMongoUserDefinitions handles the response to the MongoDBResourcesListMongoUserDefinitions request. The method always +// closes the http.Response Body. +func (c MongorbacsClient) responderForMongoDBResourcesListMongoUserDefinitions(resp *http.Response) (result MongoDBResourcesListMongoUserDefinitionsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitioncreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitioncreateupdateparameters.go new file mode 100644 index 000000000000..ad2fe42c88c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitioncreateupdateparameters.go @@ -0,0 +1,8 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoRoleDefinitionCreateUpdateParameters struct { + Properties *MongoRoleDefinitionResource `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitiongetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitiongetresults.go new file mode 100644 index 000000000000..8986ce78e6cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitiongetresults.go @@ -0,0 +1,11 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoRoleDefinitionGetResults struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MongoRoleDefinitionResource `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionlistresult.go new file mode 100644 index 000000000000..8b542dfedd65 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionlistresult.go @@ -0,0 +1,8 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoRoleDefinitionListResult struct { + Value *[]MongoRoleDefinitionGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionresource.go new file mode 100644 index 000000000000..e55975c07c7d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongoroledefinitionresource.go @@ -0,0 +1,12 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoRoleDefinitionResource struct { + DatabaseName *string `json:"databaseName,omitempty"` + Privileges *[]Privilege `json:"privileges,omitempty"` + RoleName *string `json:"roleName,omitempty"` + Roles *[]Role `json:"roles,omitempty"` + Type *MongoRoleDefinitionType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitioncreateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitioncreateupdateparameters.go new file mode 100644 index 000000000000..4430399a6f82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitioncreateupdateparameters.go @@ -0,0 +1,8 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoUserDefinitionCreateUpdateParameters struct { + Properties *MongoUserDefinitionResource `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitiongetresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitiongetresults.go new file mode 100644 index 000000000000..498a8ec34554 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitiongetresults.go @@ -0,0 +1,11 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoUserDefinitionGetResults struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MongoUserDefinitionResource `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionlistresult.go new file mode 100644 index 000000000000..ccc763d54ad4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionlistresult.go @@ -0,0 +1,8 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoUserDefinitionListResult struct { + Value *[]MongoUserDefinitionGetResults `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionresource.go new file mode 100644 index 000000000000..c5eb08adadb1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_mongouserdefinitionresource.go @@ -0,0 +1,13 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoUserDefinitionResource struct { + CustomData *string `json:"customData,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + Mechanisms *string `json:"mechanisms,omitempty"` + Password *string `json:"password,omitempty"` + Roles *[]Role `json:"roles,omitempty"` + UserName *string `json:"userName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilege.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilege.go new file mode 100644 index 000000000000..d80b1fb82c53 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilege.go @@ -0,0 +1,9 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Privilege struct { + Actions *[]string `json:"actions,omitempty"` + Resource *PrivilegeResource `json:"resource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilegeresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilegeresource.go new file mode 100644 index 000000000000..49dacb847d4b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_privilegeresource.go @@ -0,0 +1,9 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivilegeResource struct { + Collection *string `json:"collection,omitempty"` + Db *string `json:"db,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_role.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_role.go new file mode 100644 index 000000000000..7152b8c9aa6a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/model_role.go @@ -0,0 +1,9 @@ +package mongorbacs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Role struct { + Db *string `json:"db,omitempty"` + Role *string `json:"role,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/version.go new file mode 100644 index 000000000000..c3b347512f33 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/version.go @@ -0,0 +1,12 @@ +package mongorbacs + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-11-15" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/mongorbacs/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 8413ee3607ba..7af17f695bc6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -244,6 +244,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-01-02-p github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/cosmosdb github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/managedcassandras github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway +github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/cosmosdb +github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-06-01-preview/scheduledactions github.com/hashicorp/go-azure-sdk/resource-manager/customproviders/2018-09-01-preview/customresourceprovider From 754f584246c00918f410f000dd2f3d9741384c7d Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 8 Mar 2023 14:51:45 +0800 Subject: [PATCH 02/11] update code --- ...cosmosdb_mongo_user_definition_resource.go | 106 ++++++------------ 1 file changed, 34 insertions(+), 72 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index c009b6c9245f..d9d9837d8677 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -14,17 +14,12 @@ import ( ) type CosmosDbMongoUserDefinitionModel struct { - AccountId string `tfschema:"account_id"` - CustomData string `tfschema:"custom_data"` - DBName string `tfschema:"db_name"` - Password string `tfschema:"password"` - Roles []Role `tfschema:"roles"` - Username string `tfschema:"username"` -} - -type Role struct { - Db string `tfschema:"db"` - Role string `tfschema:"role"` + AccountId string `tfschema:"account_id"` + DBName string `tfschema:"db_name"` + Username string `tfschema:"username"` + Password string `tfschema:"password"` + CustomData string `tfschema:"custom_data"` + InheritedRoleNames []string `tfschema:"inherited_role_names"` } type CosmosDbMongoUserDefinitionResource struct{} @@ -79,23 +74,12 @@ func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.S ValidateFunc: validation.StringIsNotEmpty, }, - "roles": { + "inherited_role_names": { Type: pluginsdk.TypeList, Optional: true, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "db": { - Type: pluginsdk.TypeString, - Optional: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "role": { - Type: pluginsdk.TypeString, - Optional: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - }, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringIsNotEmpty, }, }, } @@ -138,18 +122,13 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { Mechanisms: utils.String("SCRAM-SHA-256"), Password: &model.Password, UserName: &model.Username, + Roles: expandInheritedRole(model.InheritedRoleNames, model.DBName), }, } - if model.CustomData != "" { - properties.Properties.CustomData = &model.CustomData - } - - rolesValue, err := expandRole(model.Roles) - if err != nil { - return err + if v := model.CustomData; v != "" { + properties.Properties.CustomData = &v } - properties.Properties.Roles = rolesValue if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id, *properties); err != nil { return fmt.Errorf("creating %s: %+v", id, err) @@ -193,6 +172,7 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { Mechanisms: utils.String("SCRAM-SHA-256"), Password: &model.Password, UserName: &model.Username, + Roles: expandInheritedRole(model.InheritedRoleNames, model.DBName), }, } @@ -200,12 +180,6 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { properties.Properties.CustomData = &model.CustomData } - rolesValue, err := expandRole(model.Roles) - if err != nil { - return err - } - properties.Properties.Roles = rolesValue - if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, *id, parameters); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -249,12 +223,7 @@ func (r CosmosDbMongoUserDefinitionResource) Read() sdk.ResourceFunc { state.Username = *properties.UserName state.Password = metadata.ResourceData.Get("password").(string) state.CustomData = metadata.ResourceData.Get("custom_data").(string) - - rolesValue, err := flattenRole(properties.Roles) - if err != nil { - return err - } - state.Roles = rolesValue + state.InheritedRoleNames = flattenInheritedRole(properties.Roles) } return metadata.Encode(&state) @@ -282,46 +251,39 @@ func (r CosmosDbMongoUserDefinitionResource) Delete() sdk.ResourceFunc { } } -func expandRole(input []Role) (*[]mongorbacs.Role, error) { +func expandInheritedRole(input []string, dbName string) *[]mongorbacs.Role { + if len(input) == 0 || dbName == "" { + return nil + } + var result []mongorbacs.Role for _, v := range input { - input := v - output := mongorbacs.Role{} - - if input.Db != "" { - output.Db = &input.Db + role := mongorbacs.Role{ + Role: utils.String(v), + Db: utils.String(dbName), } - if input.Role != "" { - output.Role = &input.Role - } - - result = append(result, output) + result = append(result, role) } - return &result, nil + return &result } -func flattenRole(input *[]mongorbacs.Role) ([]Role, error) { - var result []Role +func flattenInheritedRole(input *[]mongorbacs.Role) []string { + var result []string if input == nil { - return result, nil + return result } - for _, input := range *input { - output := Role{} - - if input.Db != nil { - output.Db = *input.Db - } - - if input.Role != nil { - output.Role = *input.Role + for _, v := range *input { + var roleName string + if role := v.Role; role != nil { + roleName = *role } - result = append(result, output) + result = append(result, roleName) } - return result, nil + return result } From 59597f5d99ef45fbd1f23de739763d65be2c89ec Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 8 Mar 2023 15:29:04 +0800 Subject: [PATCH 03/11] update code --- ...cosmosdb_mongo_user_definition_resource.go | 3 +- ...sdb_mongo_user_definition_resource_test.go | 215 ++++++++++++++++++ ...smosdb_mongo_user_definition.html.markdown | 97 ++++++++ 3 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go create mode 100644 website/docs/r/cosmosdb_mongo_user_definition.html.markdown diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index d9d9837d8677..978b7cfad3c0 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -51,7 +52,7 @@ func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.S Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, + ValidateFunc: validate.CosmosEntityName, }, "username": { diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go new file mode 100644 index 000000000000..2cdb18abc64b --- /dev/null +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go @@ -0,0 +1,215 @@ +package cosmos_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type CosmosMongoUserDefinitionResource struct{} + +func TestAccCosmosDbMongoUserDefinition_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_cosmosdb_mongo_user_definition", "test") + r := CosmosMongoUserDefinitionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeAggregateTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccCosmosDbMongoUserDefinition_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_cosmosdb_mongo_user_definition", "test") + r := CosmosMongoUserDefinitionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccCosmosDbMongoUserDefinition_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_cosmosdb_mongo_user_definition", "test") + r := CosmosMongoUserDefinitionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeAggregateTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccCosmosDbMongoUserDefinition_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_cosmosdb_mongo_user_definition", "test") + r := CosmosMongoUserDefinitionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeAggregateTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeAggregateTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r CosmosMongoUserDefinitionResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := mongorbacs.ParseMongodbUserDefinitionID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Cosmos.MongoRBACClient.MongoDBResourcesGetMongoUserDefinition(ctx, *id) + if err != nil { + return nil, fmt.Errorf("reading %q: %+v", id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (r CosmosMongoUserDefinitionResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_cosmosdb_mongo_user_definition" "test" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + username = "myUserName-%d" + password = "myPassword-%d" +} +`, r.template(data), data.RandomInteger, data.RandomInteger) +} + +func (r CosmosMongoUserDefinitionResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_cosmosdb_mongo_user_definition" "import" { + account_id = azurerm_cosmosdb_mongo_user_definition.test.account_id + db_name = azurerm_cosmosdb_mongo_user_definition.test.db_name + username = azurerm_cosmosdb_mongo_user_definition.test.username + password = azurerm_cosmosdb_mongo_user_definition.test.password +} +`, r.basic(data)) +} + +func (r CosmosMongoUserDefinitionResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_cosmosdb_mongo_role_definition" "test" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + role_name = "acctest-roledefinition-%d" +} + +resource "azurerm_cosmosdb_mongo_user_definition" "test" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + username = "myUserName-%d" + password = "myPassword-%d" + custom_data = "my Custom Data" + inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test.role_name] +} +`, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + +func (r CosmosMongoUserDefinitionResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_cosmosdb_mongo_role_definition" "test" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + role_name = "acctest-roledefinition-%d" +} + +resource "azurerm_cosmosdb_mongo_role_definition" "test2" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + role_name = "acctest-roledefinition2-%d" +} + +resource "azurerm_cosmosdb_mongo_user_definition" "test" { + account_id = azurerm_cosmosdb_account.test.id + db_name = azurerm_cosmosdb_mongo_database.test.name + username = "myUserName-%d" + password = "myPassword2-%d" + custom_data = "my Custom Data2" + inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name] +} +`, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + +func (r CosmosMongoUserDefinitionResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-mongouserdef-%d" + location = "%s" +} + +resource "azurerm_cosmosdb_account" "test" { + name = "acctest-ca-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + offer_type = "Standard" + kind = "MongoDB" + + capabilities { + name = "EnableMongo" + } + + capabilities { + name = "EnableMongoRoleBasedAccessControl" + } + + consistency_policy { + consistency_level = "Strong" + } + + geo_location { + location = azurerm_resource_group.test.location + failover_priority = 0 + } +} + +resource "azurerm_cosmosdb_mongo_database" "test" { + name = "acctest-mongodb-%d" + resource_group_name = azurerm_cosmosdb_account.test.resource_group_name + account_name = azurerm_cosmosdb_account.test.name +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} diff --git a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown new file mode 100644 index 000000000000..fb67be8972a4 --- /dev/null +++ b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown @@ -0,0 +1,97 @@ +--- +subcategory: "CosmosDB (DocumentDB)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_cosmosdb_mongo_user_definition" +description: |- + Manages a Cosmos DB Mongo User Definition. +--- + +# azurerm_cosmosdb_mongo_user_definition + +Manages a Cosmos DB Mongo User Definition. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_cosmosdb_account" "example" { + name = "example-ca" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + offer_type = "Standard" + kind = "MongoDB" + + capabilities { + name = "EnableMongo" + } + + capabilities { + name = "EnableMongoRoleBasedAccessControl" + } + + consistency_policy { + consistency_level = "Strong" + } + + geo_location { + location = azurerm_resource_group.example.location + failover_priority = 0 + } +} + +resource "azurerm_cosmosdb_mongo_database" "example" { + name = "example-mongodb" + resource_group_name = azurerm_cosmosdb_account.example.resource_group_name + account_name = azurerm_cosmosdb_account.example.name +} + +resource "azurerm_cosmosdb_mongo_user_definition" "example" { + account_id = azurerm_cosmosdb_account.example.id + db_name = azurerm_cosmosdb_mongo_database.example.name + username = "myUserName" + password = "myPassword" +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `account_id` - (Required) The ID of the Cosmos DB Account. Changing this forces a new resource to be created. + +* `db_name` - (Required) The name of the Mongo DB. Changing this forces a new resource to be created. + +* `username` - (Required) The username for the Mongo User Definition. Changing this forces a new resource to be created. + +* `password` - (Required) The password for the Mongo User Definition. + +* `custom_data` - (Optional) The custom definition for the Mongo User Definition. + +* `inherited_role_names` - (Optional) A list of Mongo Roles that are inherited to the Mongo User Definition. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Cosmos DB Mongo User Definition. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Cosmos DB Mongo User Definition. +* `read` - (Defaults to 5 minutes) Used when retrieving the Cosmos DB Mongo User Definition. +* `create` - (Defaults to 30 minutes) Used when updating the Cosmos DB Mongo User Definition. +* `delete` - (Defaults to 30 minutes) Used when deleting the Cosmos DB Mongo User Definition. + +## Import + +Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_cosmosdb_mongo_user_definition.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbUserDefinitions/dbname1.username1 +``` From 8249dc0cc23acd5b1d2f190a5d6e3df8ef70c74d Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 8 Mar 2023 15:42:08 +0800 Subject: [PATCH 04/11] update code --- .../cosmos/cosmosdb_mongo_user_definition_resource.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index 978b7cfad3c0..6052b98c6bd2 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" + "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -108,6 +109,9 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { mongoUserDefinitionId := fmt.Sprintf("%s.%s", model.DBName, model.Username) id := mongorbacs.NewMongodbUserDefinitionID(databaseAccountId.SubscriptionId, databaseAccountId.ResourceGroupName, databaseAccountId.DatabaseAccountName, mongoUserDefinitionId) + locks.ByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + defer locks.UnlockByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + existing, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil && !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for existing %s: %+v", id, err) @@ -152,6 +156,9 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { return err } + locks.ByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + defer locks.UnlockByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + var model CosmosDbMongoUserDefinitionModel if err := metadata.Decode(&model); err != nil { return fmt.Errorf("decoding: %+v", err) @@ -243,6 +250,9 @@ func (r CosmosDbMongoUserDefinitionResource) Delete() sdk.ResourceFunc { return err } + locks.ByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + defer locks.UnlockByName(id.DatabaseAccountName, CosmosDbAccountResourceName) + if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", id, err) } From 089b1ad119452b0c2a06675a052851d530232c7f Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 10 May 2023 16:12:43 +0800 Subject: [PATCH 05/11] update code --- .../2022-11-15/mongorbacs/constants.go | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go index 2ce71f91c91b..6f0897f6b738 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/constants.go @@ -1,34 +1,18 @@ package mongorbacs -import "strings" - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type MongoRoleDefinitionType string +type MongoRoleDefinitionType int64 const ( - MongoRoleDefinitionTypeBuiltInRole MongoRoleDefinitionType = "BuiltInRole" - MongoRoleDefinitionTypeCustomRole MongoRoleDefinitionType = "CustomRole" + MongoRoleDefinitionTypeOne MongoRoleDefinitionType = 1 + MongoRoleDefinitionTypeZero MongoRoleDefinitionType = 0 ) -func PossibleValuesForMongoRoleDefinitionType() []string { - return []string{ - string(MongoRoleDefinitionTypeBuiltInRole), - string(MongoRoleDefinitionTypeCustomRole), - } -} - -func parseMongoRoleDefinitionType(input string) (*MongoRoleDefinitionType, error) { - vals := map[string]MongoRoleDefinitionType{ - "builtinrole": MongoRoleDefinitionTypeBuiltInRole, - "customrole": MongoRoleDefinitionTypeCustomRole, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil +func PossibleValuesForMongoRoleDefinitionType() []int64 { + return []int64{ + int64(MongoRoleDefinitionTypeOne), + int64(MongoRoleDefinitionTypeZero), } - - // otherwise presume it's an undefined value and best-effort it - out := MongoRoleDefinitionType(input) - return &out, nil } From d407332d0d4f7e4ed57415cd9ba61de4da114f6b Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 12 May 2023 11:19:52 +0800 Subject: [PATCH 06/11] update code --- ...cosmosdb_mongo_user_definition_resource.go | 75 +++++++++---------- ...sdb_mongo_user_definition_resource_test.go | 45 +++++------ .../private_dns_zone_resource_test.go | 27 +++++-- ...smosdb_mongo_user_definition.html.markdown | 13 ++-- 4 files changed, 79 insertions(+), 81 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index 5ed2e73df948..bbb07d4d2399 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -5,19 +5,19 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type CosmosDbMongoUserDefinitionResourceModel struct { - AccountId string `tfschema:"account_id"` - DBName string `tfschema:"db_name"` + DbId string `tfschema:"db_id"` Username string `tfschema:"username"` Password string `tfschema:"password"` CustomData string `tfschema:"custom_data"` @@ -42,18 +42,11 @@ func (r CosmosDbMongoUserDefinitionResource) IDValidationFunc() pluginsdk.Schema func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ - "account_id": { + "db_id": { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: mongorbacs.ValidateDatabaseAccountID, - }, - - "db_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.CosmosEntityName, + ValidateFunc: validate.MongodbDatabaseID, }, "username": { @@ -101,13 +94,13 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { } client := metadata.Client.Cosmos.MongoRBACClient - databaseAccountId, err := mongorbacs.ParseDatabaseAccountID(model.AccountId) + databaseId, err := parse.MongodbDatabaseID(model.DbId) if err != nil { return err } - mongoUserDefinitionId := fmt.Sprintf("%s.%s", model.DBName, model.Username) - id := mongorbacs.NewMongodbUserDefinitionID(databaseAccountId.SubscriptionId, databaseAccountId.ResourceGroupName, databaseAccountId.DatabaseAccountName, mongoUserDefinitionId) + mongoUserDefinitionId := fmt.Sprintf("%s.%s", databaseId.Name, model.Username) + id := mongorbacs.NewMongodbUserDefinitionID(databaseId.SubscriptionId, databaseId.ResourceGroup, databaseId.DatabaseAccountName, mongoUserDefinitionId) locks.ByName(id.DatabaseAccountName, CosmosDbAccountResourceName) defer locks.UnlockByName(id.DatabaseAccountName, CosmosDbAccountResourceName) @@ -123,16 +116,16 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { properties := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ Properties: &mongorbacs.MongoUserDefinitionResource{ - DatabaseName: &model.DBName, - Mechanisms: utils.String("SCRAM-SHA-256"), - Password: &model.Password, - UserName: &model.Username, - Roles: expandInheritedRole(model.InheritedRoleNames, model.DBName), + DatabaseName: pointer.To(databaseId.Name), + Mechanisms: pointer.To("SCRAM-SHA-256"), + Password: pointer.To(model.Password), + UserName: pointer.To(model.Username), + Roles: expandInheritedRole(model.InheritedRoleNames, databaseId.Name), }, } if v := model.CustomData; v != "" { - properties.Properties.CustomData = &v + properties.Properties.CustomData = pointer.To(v) } if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id, properties); err != nil { @@ -174,18 +167,23 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: properties was nil", id) } + databaseId, err := parse.MongodbDatabaseID(model.DbId) + if err != nil { + return err + } + parameters := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ Properties: &mongorbacs.MongoUserDefinitionResource{ - DatabaseName: &model.DBName, - Mechanisms: utils.String("SCRAM-SHA-256"), - Password: &model.Password, - UserName: &model.Username, - Roles: expandInheritedRole(model.InheritedRoleNames, model.DBName), + DatabaseName: pointer.To(databaseId.Name), + Mechanisms: pointer.To("SCRAM-SHA-256"), + Password: pointer.To(model.Password), + UserName: pointer.To(model.Username), + Roles: expandInheritedRole(model.InheritedRoleNames, databaseId.Name), }, } if model.CustomData != "" { - properties.Properties.CustomData = &model.CustomData + properties.Properties.CustomData = pointer.To(model.CustomData) } if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, *id, parameters); err != nil { @@ -217,14 +215,14 @@ func (r CosmosDbMongoUserDefinitionResource) Read() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: %+v", *id, err) } - state := CosmosDbMongoUserDefinitionResourceModel{ - AccountId: mongorbacs.NewDatabaseAccountID(id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName).ID(), - } + state := CosmosDbMongoUserDefinitionResourceModel{} if model := resp.Model; model != nil { if properties := model.Properties; properties != nil { - state.DBName = *properties.DatabaseName - state.Username = *properties.UserName + databaseId := parse.NewMongodbDatabaseID(id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, *properties.DatabaseName) + + state.DbId = databaseId.ID() + state.Username = pointer.From(properties.UserName) state.Password = metadata.ResourceData.Get("password").(string) state.CustomData = metadata.ResourceData.Get("custom_data").(string) state.InheritedRoleNames = flattenInheritedRole(properties.Roles) @@ -260,7 +258,7 @@ func (r CosmosDbMongoUserDefinitionResource) Delete() sdk.ResourceFunc { } func expandInheritedRole(input []string, dbName string) *[]mongorbacs.Role { - if len(input) == 0 || dbName == "" { + if len(input) == 0 { return nil } @@ -268,8 +266,8 @@ func expandInheritedRole(input []string, dbName string) *[]mongorbacs.Role { for _, v := range input { role := mongorbacs.Role{ - Role: utils.String(v), - Db: utils.String(dbName), + Db: pointer.To(dbName), + Role: pointer.To(v), } result = append(result, role) @@ -285,12 +283,7 @@ func flattenInheritedRole(input *[]mongorbacs.Role) []string { } for _, v := range *input { - var roleName string - if role := v.Role; role != nil { - roleName = *role - } - - result = append(result, roleName) + result = append(result, pointer.From(v.Role)) } return result diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go index 2cdb18abc64b..aea48be905a9 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go @@ -26,7 +26,7 @@ func TestAccCosmosDbMongoUserDefinition_basic(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep(), + data.ImportStep("password"), }) } @@ -56,7 +56,7 @@ func TestAccCosmosDbMongoUserDefinition_complete(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep(), + data.ImportStep("password", "custom_data"), }) } @@ -71,14 +71,14 @@ func TestAccCosmosDbMongoUserDefinition_update(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep(), + data.ImportStep("password", "custom_data"), { Config: r.update(data), Check: acceptance.ComposeAggregateTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep(), + data.ImportStep("password", "custom_data"), }) } @@ -101,10 +101,9 @@ func (r CosmosMongoUserDefinitionResource) basic(data acceptance.TestData) strin %s resource "azurerm_cosmosdb_mongo_user_definition" "test" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name - username = "myUserName-%d" - password = "myPassword-%d" + db_id = azurerm_cosmosdb_mongo_database.test.id + username = "myUserName-%d" + password = "myPassword-%d" } `, r.template(data), data.RandomInteger, data.RandomInteger) } @@ -114,10 +113,9 @@ func (r CosmosMongoUserDefinitionResource) requiresImport(data acceptance.TestDa %s resource "azurerm_cosmosdb_mongo_user_definition" "import" { - account_id = azurerm_cosmosdb_mongo_user_definition.test.account_id - db_name = azurerm_cosmosdb_mongo_user_definition.test.db_name - username = azurerm_cosmosdb_mongo_user_definition.test.username - password = azurerm_cosmosdb_mongo_user_definition.test.password + db_id = azurerm_cosmosdb_mongo_user_definition.test.db_id + username = azurerm_cosmosdb_mongo_user_definition.test.username + password = azurerm_cosmosdb_mongo_user_definition.test.password } `, r.basic(data)) } @@ -127,14 +125,12 @@ func (r CosmosMongoUserDefinitionResource) complete(data acceptance.TestData) st %s resource "azurerm_cosmosdb_mongo_role_definition" "test" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name - role_name = "acctest-roledefinition-%d" + db_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef%d" } resource "azurerm_cosmosdb_mongo_user_definition" "test" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name + db_id = azurerm_cosmosdb_mongo_database.test.id username = "myUserName-%d" password = "myPassword-%d" custom_data = "my Custom Data" @@ -148,24 +144,21 @@ func (r CosmosMongoUserDefinitionResource) update(data acceptance.TestData) stri %s resource "azurerm_cosmosdb_mongo_role_definition" "test" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name - role_name = "acctest-roledefinition-%d" + db_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef%d" } resource "azurerm_cosmosdb_mongo_role_definition" "test2" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name - role_name = "acctest-roledefinition2-%d" + db_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef2%d" } resource "azurerm_cosmosdb_mongo_user_definition" "test" { - account_id = azurerm_cosmosdb_account.test.id - db_name = azurerm_cosmosdb_mongo_database.test.name + db_id = azurerm_cosmosdb_mongo_database.test.id username = "myUserName-%d" password = "myPassword2-%d" custom_data = "my Custom Data2" - inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name] + inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name, azurerm_cosmosdb_mongo_role_definition.test.role_name] } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } diff --git a/internal/services/privatedns/private_dns_zone_resource_test.go b/internal/services/privatedns/private_dns_zone_resource_test.go index a5af7256ef79..bda24441bd60 100644 --- a/internal/services/privatedns/private_dns_zone_resource_test.go +++ b/internal/services/privatedns/private_dns_zone_resource_test.go @@ -54,13 +54,6 @@ func TestAccPrivateDnsZone_withTags(t *testing.T) { check.That(data.ResourceName).Key("tags.%").HasValue("2"), ), }, - { - Config: r.withTagsUpdate(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("tags.%").HasValue("1"), - ), - }, data.ImportStep(), }) } @@ -121,6 +114,26 @@ resource "azurerm_resource_group" "test" { resource "azurerm_private_dns_zone" "test" { name = "acctestzone%d.com" resource_group_name = azurerm_resource_group.test.name + + tags = { + Env1 = "Test1" + Env2 = "Test2" + Env3 = "Test3" + Env4 = "Test4" + Env5 = "Test5" + Env6 = "Test6" + Env7 = "Test7" + Env8 = "Test8" + Env9 = "Test9" + Env10 = "Test0" + Env11 = "Test11" + Env12 = "Test12" + Env13 = "Test13" + Env14 = "Test14" + Env15 = "Test15" + Env16 = "Test16" + Env17 = "Test17" + } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } diff --git a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown index fb67be8972a4..6b04055b6f51 100644 --- a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown +++ b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown @@ -50,10 +50,9 @@ resource "azurerm_cosmosdb_mongo_database" "example" { } resource "azurerm_cosmosdb_mongo_user_definition" "example" { - account_id = azurerm_cosmosdb_account.example.id - db_name = azurerm_cosmosdb_mongo_database.example.name - username = "myUserName" - password = "myPassword" + db_id = azurerm_cosmosdb_mongo_database.example.id + username = "myUserName" + password = "myPassword" } ``` @@ -61,9 +60,7 @@ resource "azurerm_cosmosdb_mongo_user_definition" "example" { The following arguments are supported: -* `account_id` - (Required) The ID of the Cosmos DB Account. Changing this forces a new resource to be created. - -* `db_name` - (Required) The name of the Mongo DB. Changing this forces a new resource to be created. +* `db_id` - (Required) The resource ID of the Mongo DB. Changing this forces a new resource to be created. * `username` - (Required) The username for the Mongo User Definition. Changing this forces a new resource to be created. @@ -73,6 +70,8 @@ The following arguments are supported: * `inherited_role_names` - (Optional) A list of Mongo Roles that are inherited to the Mongo User Definition. +~> **Note:** The role that needs to be inherited should exist in the Mongo DB of `db_id`. + ## Attributes Reference In addition to the Arguments listed above - the following Attributes are exported: From d912763e96cedd01560745102a1c0e440c0fda85 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 12 May 2023 12:48:45 +0800 Subject: [PATCH 07/11] update code --- .../cosmosdb_mongo_user_definition_resource.go | 16 ---------------- ...smosdb_mongo_user_definition_resource_test.go | 8 +++----- .../2022-11-15/mongorbacs/id_databaseaccount.go | 12 ++++++------ .../mongorbacs/id_mongodbroledefinition.go | 16 ++++++++-------- .../mongorbacs/id_mongodbuserdefinition.go | 16 ++++++++-------- .../cosmosdb_mongo_user_definition.html.markdown | 2 -- 6 files changed, 25 insertions(+), 45 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index bbb07d4d2399..6a2496b44a80 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -20,7 +20,6 @@ type CosmosDbMongoUserDefinitionResourceModel struct { DbId string `tfschema:"db_id"` Username string `tfschema:"username"` Password string `tfschema:"password"` - CustomData string `tfschema:"custom_data"` InheritedRoleNames []string `tfschema:"inherited_role_names"` } @@ -63,12 +62,6 @@ func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.S ValidateFunc: validation.StringIsNotEmpty, }, - "custom_data": { - Type: pluginsdk.TypeString, - Optional: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - "inherited_role_names": { Type: pluginsdk.TypeList, Optional: true, @@ -124,10 +117,6 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { }, } - if v := model.CustomData; v != "" { - properties.Properties.CustomData = pointer.To(v) - } - if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id, properties); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -182,10 +171,6 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { }, } - if model.CustomData != "" { - properties.Properties.CustomData = pointer.To(model.CustomData) - } - if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, *id, parameters); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -224,7 +209,6 @@ func (r CosmosDbMongoUserDefinitionResource) Read() sdk.ResourceFunc { state.DbId = databaseId.ID() state.Username = pointer.From(properties.UserName) state.Password = metadata.ResourceData.Get("password").(string) - state.CustomData = metadata.ResourceData.Get("custom_data").(string) state.InheritedRoleNames = flattenInheritedRole(properties.Roles) } } diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go index aea48be905a9..ca16565144ea 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go @@ -56,7 +56,7 @@ func TestAccCosmosDbMongoUserDefinition_complete(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep("password", "custom_data"), + data.ImportStep("password"), }) } @@ -71,14 +71,14 @@ func TestAccCosmosDbMongoUserDefinition_update(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep("password", "custom_data"), + data.ImportStep("password"), { Config: r.update(data), Check: acceptance.ComposeAggregateTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - data.ImportStep("password", "custom_data"), + data.ImportStep("password"), }) } @@ -133,7 +133,6 @@ resource "azurerm_cosmosdb_mongo_user_definition" "test" { db_id = azurerm_cosmosdb_mongo_database.test.id username = "myUserName-%d" password = "myPassword-%d" - custom_data = "my Custom Data" inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test.role_name] } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger) @@ -157,7 +156,6 @@ resource "azurerm_cosmosdb_mongo_user_definition" "test" { db_id = azurerm_cosmosdb_mongo_database.test.id username = "myUserName-%d" password = "myPassword2-%d" - custom_data = "my Custom Data2" inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name, azurerm_cosmosdb_mongo_role_definition.test.role_name] } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go index e8d13a2bbbac..9edb9717313c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go @@ -40,15 +40,15 @@ func ParseDatabaseAccountID(input string) (*DatabaseAccountId, error) { id := DatabaseAccountId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } return &id, nil @@ -67,15 +67,15 @@ func ParseDatabaseAccountIDInsensitively(input string) (*DatabaseAccountId, erro id := DatabaseAccountId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } return &id, nil diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go index f6646312c834..a5dad9eda742 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go @@ -42,19 +42,19 @@ func ParseMongodbRoleDefinitionID(input string) (*MongodbRoleDefinitionId, error id := MongodbRoleDefinitionId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } if id.MongoRoleDefinitionId, ok = parsed.Parsed["mongoRoleDefinitionId"]; !ok { - return nil, fmt.Errorf("the segment 'mongoRoleDefinitionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "mongoRoleDefinitionId", *parsed) } return &id, nil @@ -73,19 +73,19 @@ func ParseMongodbRoleDefinitionIDInsensitively(input string) (*MongodbRoleDefini id := MongodbRoleDefinitionId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } if id.MongoRoleDefinitionId, ok = parsed.Parsed["mongoRoleDefinitionId"]; !ok { - return nil, fmt.Errorf("the segment 'mongoRoleDefinitionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "mongoRoleDefinitionId", *parsed) } return &id, nil diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go index 6e82be3cc647..5e5016590a7f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go @@ -42,19 +42,19 @@ func ParseMongodbUserDefinitionID(input string) (*MongodbUserDefinitionId, error id := MongodbUserDefinitionId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } if id.MongoUserDefinitionId, ok = parsed.Parsed["mongoUserDefinitionId"]; !ok { - return nil, fmt.Errorf("the segment 'mongoUserDefinitionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "mongoUserDefinitionId", *parsed) } return &id, nil @@ -73,19 +73,19 @@ func ParseMongodbUserDefinitionIDInsensitively(input string) (*MongodbUserDefini id := MongodbUserDefinitionId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) } if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) } if id.DatabaseAccountName, ok = parsed.Parsed["databaseAccountName"]; !ok { - return nil, fmt.Errorf("the segment 'databaseAccountName' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "databaseAccountName", *parsed) } if id.MongoUserDefinitionId, ok = parsed.Parsed["mongoUserDefinitionId"]; !ok { - return nil, fmt.Errorf("the segment 'mongoUserDefinitionId' was not found in the resource id %q", input) + return nil, resourceids.NewSegmentNotSpecifiedError(id, "mongoUserDefinitionId", *parsed) } return &id, nil diff --git a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown index 6b04055b6f51..608ca45a8fed 100644 --- a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown +++ b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown @@ -66,8 +66,6 @@ The following arguments are supported: * `password` - (Required) The password for the Mongo User Definition. -* `custom_data` - (Optional) The custom definition for the Mongo User Definition. - * `inherited_role_names` - (Optional) A list of Mongo Roles that are inherited to the Mongo User Definition. ~> **Note:** The role that needs to be inherited should exist in the Mongo DB of `db_id`. From e6f18944a465774828d53e8061e5776886e0e97a Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 24 May 2023 10:36:00 +0800 Subject: [PATCH 08/11] update code --- .../private_dns_zone_resource_test.go | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/internal/services/privatedns/private_dns_zone_resource_test.go b/internal/services/privatedns/private_dns_zone_resource_test.go index bda24441bd60..7ca1812b602e 100644 --- a/internal/services/privatedns/private_dns_zone_resource_test.go +++ b/internal/services/privatedns/private_dns_zone_resource_test.go @@ -55,6 +55,14 @@ func TestAccPrivateDnsZone_withTags(t *testing.T) { ), }, data.ImportStep(), + { + Config: r.withTagsUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("tags.%").HasValue("1"), + ), + }, + data.ImportStep(), }) } @@ -114,26 +122,6 @@ resource "azurerm_resource_group" "test" { resource "azurerm_private_dns_zone" "test" { name = "acctestzone%d.com" resource_group_name = azurerm_resource_group.test.name - - tags = { - Env1 = "Test1" - Env2 = "Test2" - Env3 = "Test3" - Env4 = "Test4" - Env5 = "Test5" - Env6 = "Test6" - Env7 = "Test7" - Env8 = "Test8" - Env9 = "Test9" - Env10 = "Test0" - Env11 = "Test11" - Env12 = "Test12" - Env13 = "Test13" - Env14 = "Test14" - Env15 = "Test15" - Env16 = "Test16" - Env17 = "Test17" - } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } From 5c1fe118529fcea86eeb891cb75aaa6a96129307 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 24 May 2023 10:37:04 +0800 Subject: [PATCH 09/11] update code --- internal/services/privatedns/private_dns_zone_resource_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/privatedns/private_dns_zone_resource_test.go b/internal/services/privatedns/private_dns_zone_resource_test.go index 7ca1812b602e..a5af7256ef79 100644 --- a/internal/services/privatedns/private_dns_zone_resource_test.go +++ b/internal/services/privatedns/private_dns_zone_resource_test.go @@ -54,7 +54,6 @@ func TestAccPrivateDnsZone_withTags(t *testing.T) { check.That(data.ResourceName).Key("tags.%").HasValue("2"), ), }, - data.ImportStep(), { Config: r.withTagsUpdate(data), Check: acceptance.ComposeTestCheckFunc( From 7485180c7f574a9126e51fe0465e4f6bcc3061f6 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 24 May 2023 12:22:57 +0800 Subject: [PATCH 10/11] update code --- ...cosmosdb_mongo_user_definition_resource.go | 16 ++++---- ...sdb_mongo_user_definition_resource_test.go | 40 +++++++++---------- ...smosdb_mongo_user_definition.html.markdown | 12 +++--- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index 6a2496b44a80..3413110c0e54 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -17,10 +17,10 @@ import ( ) type CosmosDbMongoUserDefinitionResourceModel struct { - DbId string `tfschema:"db_id"` - Username string `tfschema:"username"` - Password string `tfschema:"password"` - InheritedRoleNames []string `tfschema:"inherited_role_names"` + CosmosMongoDatabaseId string `tfschema:"cosmos_mongo_database_id"` + Username string `tfschema:"username"` + Password string `tfschema:"password"` + InheritedRoleNames []string `tfschema:"inherited_role_names"` } type CosmosDbMongoUserDefinitionResource struct{} @@ -41,7 +41,7 @@ func (r CosmosDbMongoUserDefinitionResource) IDValidationFunc() pluginsdk.Schema func (r CosmosDbMongoUserDefinitionResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ - "db_id": { + "cosmos_mongo_database_id": { Type: pluginsdk.TypeString, Required: true, ForceNew: true, @@ -87,7 +87,7 @@ func (r CosmosDbMongoUserDefinitionResource) Create() sdk.ResourceFunc { } client := metadata.Client.Cosmos.MongoRBACClient - databaseId, err := parse.MongodbDatabaseID(model.DbId) + databaseId, err := parse.MongodbDatabaseID(model.CosmosMongoDatabaseId) if err != nil { return err } @@ -156,7 +156,7 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: properties was nil", id) } - databaseId, err := parse.MongodbDatabaseID(model.DbId) + databaseId, err := parse.MongodbDatabaseID(model.CosmosMongoDatabaseId) if err != nil { return err } @@ -206,7 +206,7 @@ func (r CosmosDbMongoUserDefinitionResource) Read() sdk.ResourceFunc { if properties := model.Properties; properties != nil { databaseId := parse.NewMongodbDatabaseID(id.SubscriptionId, id.ResourceGroupName, id.DatabaseAccountName, *properties.DatabaseName) - state.DbId = databaseId.ID() + state.CosmosMongoDatabaseId = databaseId.ID() state.Username = pointer.From(properties.UserName) state.Password = metadata.ResourceData.Get("password").(string) state.InheritedRoleNames = flattenInheritedRole(properties.Roles) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go index ca16565144ea..232a38412351 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource_test.go @@ -101,9 +101,9 @@ func (r CosmosMongoUserDefinitionResource) basic(data acceptance.TestData) strin %s resource "azurerm_cosmosdb_mongo_user_definition" "test" { - db_id = azurerm_cosmosdb_mongo_database.test.id - username = "myUserName-%d" - password = "myPassword-%d" + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + username = "myUserName-%d" + password = "myPassword-%d" } `, r.template(data), data.RandomInteger, data.RandomInteger) } @@ -113,9 +113,9 @@ func (r CosmosMongoUserDefinitionResource) requiresImport(data acceptance.TestDa %s resource "azurerm_cosmosdb_mongo_user_definition" "import" { - db_id = azurerm_cosmosdb_mongo_user_definition.test.db_id - username = azurerm_cosmosdb_mongo_user_definition.test.username - password = azurerm_cosmosdb_mongo_user_definition.test.password + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_user_definition.test.cosmos_mongo_database_id + username = azurerm_cosmosdb_mongo_user_definition.test.username + password = azurerm_cosmosdb_mongo_user_definition.test.password } `, r.basic(data)) } @@ -125,15 +125,15 @@ func (r CosmosMongoUserDefinitionResource) complete(data acceptance.TestData) st %s resource "azurerm_cosmosdb_mongo_role_definition" "test" { - db_id = azurerm_cosmosdb_mongo_database.test.id - role_name = "acctestmongoroledef%d" + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef%d" } resource "azurerm_cosmosdb_mongo_user_definition" "test" { - db_id = azurerm_cosmosdb_mongo_database.test.id - username = "myUserName-%d" - password = "myPassword-%d" - inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test.role_name] + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + username = "myUserName-%d" + password = "myPassword-%d" + inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test.role_name] } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger) } @@ -143,20 +143,20 @@ func (r CosmosMongoUserDefinitionResource) update(data acceptance.TestData) stri %s resource "azurerm_cosmosdb_mongo_role_definition" "test" { - db_id = azurerm_cosmosdb_mongo_database.test.id - role_name = "acctestmongoroledef%d" + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef%d" } resource "azurerm_cosmosdb_mongo_role_definition" "test2" { - db_id = azurerm_cosmosdb_mongo_database.test.id - role_name = "acctestmongoroledef2%d" + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + role_name = "acctestmongoroledef2%d" } resource "azurerm_cosmosdb_mongo_user_definition" "test" { - db_id = azurerm_cosmosdb_mongo_database.test.id - username = "myUserName-%d" - password = "myPassword2-%d" - inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name, azurerm_cosmosdb_mongo_role_definition.test.role_name] + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.test.id + username = "myUserName-%d" + password = "myPassword2-%d" + inherited_role_names = [azurerm_cosmosdb_mongo_role_definition.test2.role_name, azurerm_cosmosdb_mongo_role_definition.test.role_name] } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } diff --git a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown index 608ca45a8fed..94aed01029f0 100644 --- a/website/docs/r/cosmosdb_mongo_user_definition.html.markdown +++ b/website/docs/r/cosmosdb_mongo_user_definition.html.markdown @@ -50,9 +50,9 @@ resource "azurerm_cosmosdb_mongo_database" "example" { } resource "azurerm_cosmosdb_mongo_user_definition" "example" { - db_id = azurerm_cosmosdb_mongo_database.example.id - username = "myUserName" - password = "myPassword" + cosmos_mongo_database_id = azurerm_cosmosdb_mongo_database.example.id + username = "myUserName" + password = "myPassword" } ``` @@ -60,7 +60,7 @@ resource "azurerm_cosmosdb_mongo_user_definition" "example" { The following arguments are supported: -* `db_id` - (Required) The resource ID of the Mongo DB. Changing this forces a new resource to be created. +* `cosmos_mongo_database_id` - (Required) The resource ID of the Mongo DB. Changing this forces a new resource to be created. * `username` - (Required) The username for the Mongo User Definition. Changing this forces a new resource to be created. @@ -68,7 +68,7 @@ The following arguments are supported: * `inherited_role_names` - (Optional) A list of Mongo Roles that are inherited to the Mongo User Definition. -~> **Note:** The role that needs to be inherited should exist in the Mongo DB of `db_id`. +~> **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmos_mongo_database_id`. ## Attributes Reference @@ -82,7 +82,7 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/d * `create` - (Defaults to 30 minutes) Used when creating the Cosmos DB Mongo User Definition. * `read` - (Defaults to 5 minutes) Used when retrieving the Cosmos DB Mongo User Definition. -* `create` - (Defaults to 30 minutes) Used when updating the Cosmos DB Mongo User Definition. +* `update` - (Defaults to 30 minutes) Used when updating the Cosmos DB Mongo User Definition. * `delete` - (Defaults to 30 minutes) Used when deleting the Cosmos DB Mongo User Definition. ## Import From 089638fe6a033acdf307e714d74e43c6b72d9fa5 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 25 May 2023 10:01:58 +0800 Subject: [PATCH 11/11] update code --- ...cosmosdb_mongo_user_definition_resource.go | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go index 3413110c0e54..23fed482cead 100644 --- a/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_user_definition_resource.go @@ -162,13 +162,15 @@ func (r CosmosDbMongoUserDefinitionResource) Update() sdk.ResourceFunc { } parameters := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ - Properties: &mongorbacs.MongoUserDefinitionResource{ - DatabaseName: pointer.To(databaseId.Name), - Mechanisms: pointer.To("SCRAM-SHA-256"), - Password: pointer.To(model.Password), - UserName: pointer.To(model.Username), - Roles: expandInheritedRole(model.InheritedRoleNames, databaseId.Name), - }, + Properties: properties.Properties, + } + + if metadata.ResourceData.HasChange("password") { + parameters.Properties.Password = pointer.To(model.Password) + } + + if metadata.ResourceData.HasChange("inherited_role_names") { + parameters.Properties.Roles = expandInheritedRole(model.InheritedRoleNames, databaseId.Name) } if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, *id, parameters); err != nil { @@ -246,7 +248,7 @@ func expandInheritedRole(input []string, dbName string) *[]mongorbacs.Role { return nil } - var result []mongorbacs.Role + result := make([]mongorbacs.Role, 0) for _, v := range input { role := mongorbacs.Role{ @@ -261,7 +263,7 @@ func expandInheritedRole(input []string, dbName string) *[]mongorbacs.Role { } func flattenInheritedRole(input *[]mongorbacs.Role) []string { - var result []string + result := make([]string, 0) if input == nil { return result }