From bc973c11ef84eff0a56a82f5434c4a423d14afc7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 15 Nov 2021 03:28:20 +0000 Subject: [PATCH] CodeGen from PR 16211 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-10-15-preview (#16211) * Adds base for updating Microsoft.DocumentDB from version preview/2021-07-01-preview to version 2021-10-15-preview * Updates readme * Updates API version in new specs and examples * Antoshni cosmos db 2021 10 15 preview cek management (#1) * Adds base for updating Microsoft.DocumentDB from version preview/2021-07-01-preview to version 2021-10-15-preview * Updates readme * Updates API version in new specs and examples * ClientEncryptionKey management API changes * Address semantics validation errors * Fix representation of wrappedDek * fix Swagger prettier formatting check * minor edits to address comments" * fix LintDiff error * Adds base for updating Microsoft.DocumentDB from version preview/2021-07-01-preview to version 2021-10-15-preview * Updates readme * Updates API version in new specs and examples * remove CreateUpdateOptions as they arent applicable for CEK * fix Model validation check Co-authored-by: anujtoshniwal <62551957+anujtoshniwal@users.noreply.github.com> Co-authored-by: Anuj Toshniwal * mongo rbac cherry-pick (#5) * mongo rbac cherry-pick * Removing entry for 07 preview Co-authored-by: kavskalyan * Revert "mongo rbac cherry-pick (#5)" (#7) This reverts commit 8392017d66f23eb96aa6032681bbfd254f0fd019. * preview swagger for managed cassandra (#8) * preview swagger for managed cassandra * add cassandraAuditLoggingEnabled property * change property name in CommandPostBody Co-authored-by: Vivek Sundararajan * fix validation, remove connectivity (#11) Co-authored-by: Vivek Sundararajan * Add data transfer job api (#2) * Adds base for updating Microsoft.DocumentDB from version preview/2021-07-01-preview to version 2021-10-15-preview * Updates readme * Updates API version in new specs and examples * Add DataTransfer job apis * Fix api version * Rename connection to endpointUrl * Rename connection to endpointUrl * Add dataTransferService in readme.md * Fix keys * Fix checks * Add worker count * Fix worker count * MaterializedViewsBuilder (#12) * Adding LatestRestorableTimestamp support for MongoDB collections. (#9) * Adding LatestRestorableTimestamp support for MongoDB * Fixing api version for examples. * Mongo RBAC Swagger Changes (#10) * mongo rbac cherry-pick * Removing entry for 07 preview * Fixing swagger issues * Fixing swagger error for param * Fixing misplaced Description * Fixing model validation issues * Json pretty formatting * Fixing more model validation issues * Fixing type issue * Add password field for userdef request * Fixing URL param * Fixing URL param issue Co-authored-by: kavskalyan * TotalThroughput limit 10-15 preview API changes (#6) * add backupStorageCustomerKeyUri and fix response status code (#13) * fix validation, remove connectivity * add backupStorageCustomerKeyUri property * fix response status code Co-authored-by: Vivek Sundararajan * Prettier fix * Fix Avocado check * Fix operationId * Fix operationId * Fix breaking change * Fix breaking change (managedCassandra invokeCommand) * Fix breaking change * Fix status code in example * Fix review comment * Use v3 version for resource-management * Fix client encryption review comments * update location header in example (#15) Co-authored-by: Vivek Sundararajan * Prettier fix * update header in response * formating json Co-authored-by: anujtoshniwal <62551957+anujtoshniwal@users.noreply.github.com> Co-authored-by: Anuj Toshniwal Co-authored-by: Abhijit Karanjkar Co-authored-by: kavskalyan Co-authored-by: vivek-microsoft <32766101+vivek-microsoft@users.noreply.github.com> Co-authored-by: Vivek Sundararajan Co-authored-by: Ajay Parulekar <79739098+ajparule@users.noreply.github.com> Co-authored-by: Amit Singh <31076927+amisi01@users.noreply.github.com> Co-authored-by: pjohari-ms <84465928+pjohari-ms@users.noreply.github.com> --- .../mgmt/2015-04-08/documentdb/CHANGELOG.md | 2 +- .../mgmt/2015-04-08/documentdb/_meta.json | 2 +- .../mgmt/2019-08-01/documentdb/CHANGELOG.md | 2 +- .../mgmt/2019-08-01/documentdb/_meta.json | 2 +- .../documentdb/notebookworkspaces.go | 21 +- .../mgmt/2021-01-15/documentdb/CHANGELOG.md | 2 +- .../mgmt/2021-01-15/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../mgmt/2021-01-15/documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../2021-01-15/documentdb/collectionregion.go | 3 +- .../mgmt/2021-01-15/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../2021-01-15/documentdb/databaseaccounts.go | 48 +- .../2021-01-15/documentdb/gremlinresources.go | 48 +- .../2021-01-15/documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../mgmt/2021-01-15/documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../2021-01-15/documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../2021-01-15/documentdb/sqlresources.go | 84 +- .../2021-01-15/documentdb/tableresources.go | 24 +- .../mgmt/2021-03-15/documentdb/CHANGELOG.md | 2 +- .../mgmt/2021-03-15/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../mgmt/2021-03-15/documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../2021-03-15/documentdb/collectionregion.go | 3 +- .../mgmt/2021-03-15/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../2021-03-15/documentdb/databaseaccounts.go | 48 +- .../2021-03-15/documentdb/gremlinresources.go | 48 +- .../2021-03-15/documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../mgmt/2021-03-15/documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../2021-03-15/documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../2021-03-15/documentdb/sqlresources.go | 84 +- .../2021-03-15/documentdb/tableresources.go | 24 +- .../mgmt/2021-04-15/documentdb/CHANGELOG.md | 2 + .../mgmt/2021-04-15/documentdb/_meta.json | 11 + .../documentdb/cassandraresources.go | 1573 ++ .../mgmt/2021-04-15/documentdb/client.go | 41 + .../mgmt/2021-04-15/documentdb/collection.go | 320 + .../documentdb/collectionpartition.go | 228 + .../documentdb/collectionpartitionregion.go | 133 + .../2021-04-15/documentdb/collectionregion.go | 133 + .../mgmt/2021-04-15/documentdb/database.go | 314 + .../documentdb/databaseaccountregion.go | 128 + .../2021-04-15/documentdb/databaseaccounts.go | 1676 ++ .../documentdb/documentdbapi/interfaces.go | 280 + .../mgmt/2021-04-15/documentdb/enums.go | 410 + .../2021-04-15/documentdb/gremlinresources.go | 1577 ++ .../mgmt/2021-04-15/documentdb/models.go | 9490 +++++++++++ .../2021-04-15/documentdb/mongodbresources.go | 1573 ++ .../documentdb/notebookworkspaces.go | 674 + .../mgmt/2021-04-15/documentdb/operations.go | 140 + .../documentdb/partitionkeyrangeid.go | 132 + .../documentdb/partitionkeyrangeidregion.go | 134 + .../mgmt/2021-04-15/documentdb/percentile.go | 126 + .../documentdb/percentilesourcetarget.go | 133 + .../2021-04-15/documentdb/percentiletarget.go | 130 + .../documentdb/privateendpointconnections.go | 402 + .../documentdb/privatelinkresources.go | 213 + .../2021-04-15/documentdb/sqlresources.go | 3487 ++++ .../2021-04-15/documentdb/tableresources.go | 791 + .../mgmt/2021-04-15/documentdb/version.go | 19 + .../mgmt/2021-05-15/documentdb/CHANGELOG.md | 2 +- .../mgmt/2021-05-15/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../mgmt/2021-05-15/documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../2021-05-15/documentdb/collectionregion.go | 3 +- .../mgmt/2021-05-15/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../2021-05-15/documentdb/databaseaccounts.go | 48 +- .../2021-05-15/documentdb/gremlinresources.go | 48 +- .../2021-05-15/documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../mgmt/2021-05-15/documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../2021-05-15/documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../2021-05-15/documentdb/sqlresources.go | 108 +- .../2021-05-15/documentdb/tableresources.go | 24 +- .../mgmt/2021-06-15/documentdb/CHANGELOG.md | 2 +- .../mgmt/2021-06-15/documentdb/_meta.json | 2 +- .../mgmt/2021-10-15/documentdb/CHANGELOG.md | 2 +- .../mgmt/2021-10-15/documentdb/_meta.json | 2 +- .../documentdb/CHANGELOG.md | 2 +- .../2019-08-01-preview/documentdb/_meta.json | 2 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/CHANGELOG.md | 2 +- .../2019-12-12-preview/documentdb/_meta.json | 2 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/CHANGELOG.md | 2 +- .../2020-03-01-preview/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../documentdb/collectionregion.go | 3 +- .../2020-03-01-preview/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../documentdb/databaseaccounts.go | 48 +- .../documentdb/gremlinresources.go | 48 +- .../documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/sqlresources.go | 84 +- .../documentdb/tableresources.go | 24 +- .../documentdb/CHANGELOG.md | 2 +- .../2020-04-01-preview/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../documentdb/collectionregion.go | 3 +- .../2020-04-01-preview/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../documentdb/databaseaccounts.go | 48 +- .../documentdb/gremlinresources.go | 48 +- .../documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/sqlresources.go | 84 +- .../documentdb/tableresources.go | 24 +- .../documentdb/CHANGELOG.md | 48 +- .../2020-06-01-preview/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 36 +- .../documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../documentdb/collectionregion.go | 3 +- .../2020-06-01-preview/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../documentdb/databaseaccounts.go | 48 +- .../2020-06-01-preview/documentdb/enums.go | 17 + .../documentdb/gremlinresources.go | 36 +- .../2020-06-01-preview/documentdb/models.go | 309 +- .../documentdb/mongodbresources.go | 36 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/restorabledatabaseaccounts.go | 8 +- .../restorablemongodbcollections.go | 6 +- .../documentdb/restorablemongodbdatabases.go | 4 +- .../documentdb/restorablemongodbresources.go | 5 +- .../documentdb/restorablesqlcontainers.go | 6 +- .../documentdb/restorablesqldatabases.go | 4 +- .../documentdb/restorablesqlresources.go | 5 +- .../documentdb/sqlresources.go | 96 +- .../documentdb/tableresources.go | 18 +- .../documentdb/CHANGELOG.md | 2 +- .../2020-09-01-preview/documentdb/_meta.json | 2 +- .../documentdb/cassandraresources.go | 48 +- .../documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../documentdb/collectionregion.go | 3 +- .../2020-09-01-preview/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../documentdb/databaseaccounts.go | 48 +- .../documentdb/gremlinresources.go | 48 +- .../documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../documentdb/sqlresources.go | 84 +- .../documentdb/tableresources.go | 24 +- .../documentdb/CHANGELOG.md | 2 +- .../2021-03-01-preview/documentdb/_meta.json | 2 +- .../documentdb/CHANGELOG.md | 40 +- .../2021-04-01-preview/documentdb/_meta.json | 2 +- .../documentdb/cassandraclusters.go | 43 +- .../documentdb/cassandradatacenters.go | 33 +- .../documentdb/cassandraresources.go | 48 +- .../documentdb/collection.go | 9 +- .../documentdb/collectionpartition.go | 6 +- .../documentdb/collectionpartitionregion.go | 3 +- .../documentdb/collectionregion.go | 3 +- .../2021-04-01-preview/documentdb/database.go | 9 +- .../documentdb/databaseaccountregion.go | 3 +- .../documentdb/databaseaccounts.go | 48 +- .../documentdb/documentdbapi/interfaces.go | 2 +- .../2021-04-01-preview/documentdb/enums.go | 10 +- .../documentdb/gremlinresources.go | 48 +- .../2021-04-01-preview/documentdb/models.go | 62 +- .../documentdb/mongodbresources.go | 48 +- .../documentdb/notebookworkspaces.go | 21 +- .../documentdb/partitionkeyrangeid.go | 3 +- .../documentdb/partitionkeyrangeidregion.go | 3 +- .../documentdb/percentile.go | 3 +- .../documentdb/percentilesourcetarget.go | 3 +- .../documentdb/percentiletarget.go | 3 +- .../documentdb/privateendpointconnections.go | 12 +- .../documentdb/privatelinkresources.go | 6 +- .../2021-04-01-preview/documentdb/service.go | 23 +- .../documentdb/sqlresources.go | 111 +- .../documentdb/tableresources.go | 24 +- .../documentdb/CHANGELOG.md | 2 + .../2021-07-01-preview/documentdb/_meta.json | 11 + .../documentdb/cassandraclusters.go | 936 ++ .../documentdb/cassandradatacenters.go | 517 + .../documentdb/cassandraresources.go | 2350 +++ .../2021-07-01-preview/documentdb/client.go | 203 + .../documentdb/collection.go | 320 + .../documentdb/collectionpartition.go | 228 + .../documentdb/collectionpartitionregion.go | 133 + .../documentdb/collectionregion.go | 133 + .../2021-07-01-preview/documentdb/database.go | 314 + .../documentdb/databaseaccountregion.go | 128 + .../documentdb/databaseaccounts.go | 1676 ++ .../documentdb/documentdbapi/interfaces.go | 395 + .../2021-07-01-preview/documentdb/enums.go | 718 + .../documentdb/graphresources.go | 407 + .../documentdb/gremlinresources.go | 1577 ++ .../2021-07-01-preview/documentdb/models.go | 13334 ++++++++++++++++ .../documentdb/mongodbresources.go | 1573 ++ .../documentdb/notebookworkspaces.go | 674 + .../documentdb/operations.go | 140 + .../documentdb/partitionkeyrangeid.go | 132 + .../documentdb/partitionkeyrangeidregion.go | 134 + .../documentdb/percentile.go | 126 + .../documentdb/percentilesourcetarget.go | 133 + .../documentdb/percentiletarget.go | 130 + .../documentdb/privateendpointconnections.go | 402 + .../documentdb/privatelinkresources.go | 213 + .../documentdb/restorabledatabaseaccounts.go | 275 + .../restorablemongodbcollections.go | 122 + .../documentdb/restorablemongodbdatabases.go | 117 + .../documentdb/restorablemongodbresources.go | 125 + .../documentdb/restorablesqlcontainers.go | 129 + .../documentdb/restorablesqldatabases.go | 117 + .../documentdb/restorablesqlresources.go | 125 + .../2021-07-01-preview/documentdb/service.go | 416 + .../documentdb/sqlresources.go | 3586 +++++ .../documentdb/tableresources.go | 791 + .../2021-07-01-preview/documentdb/version.go | 19 + 279 files changed, 58529 insertions(+), 2499 deletions(-) create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/CHANGELOG.md create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/_meta.json create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/cassandraresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/client.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/collection.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartition.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartitionregion.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/collectionregion.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/database.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccountregion.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccounts.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/documentdbapi/interfaces.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/enums.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/gremlinresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/models.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/mongodbresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/notebookworkspaces.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/operations.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeid.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeidregion.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/percentile.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/percentilesourcetarget.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/percentiletarget.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/privateendpointconnections.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/privatelinkresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/sqlresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/tableresources.go create mode 100644 services/cosmos-db/mgmt/2021-04-15/documentdb/version.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/CHANGELOG.md create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/_meta.json create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraclusters.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandradatacenters.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/client.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collection.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartition.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartitionregion.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionregion.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/database.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccountregion.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccounts.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/documentdbapi/interfaces.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/enums.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/graphresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/gremlinresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/models.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/mongodbresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/notebookworkspaces.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/operations.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeid.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeidregion.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentile.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentilesourcetarget.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentiletarget.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privateendpointconnections.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privatelinkresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorabledatabaseaccounts.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbcollections.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbdatabases.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlcontainers.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqldatabases.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/service.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/sqlresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/tableresources.go create mode 100644 services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/version.go diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2015-04-08/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/_meta.json b/services/cosmos-db/mgmt/2015-04-08/documentdb/_meta.json index 9d9d591cf7b7..ca90cd1521e3 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2015-04", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2019-08-01/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/_meta.json b/services/cosmos-db/mgmt/2019-08-01/documentdb/_meta.json index 1ed4280defb1..9727d91b16b7 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2019-08", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go index 5e26f0f3138a..19d3fc9c1361 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-01-15/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-01-15/documentdb/_meta.json index 4cc49d524c98..eec6b05452ee 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "8240593bde5350e6762015523ccd57cb61e32da5", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/cassandraresources.go index 5bf6cebe7969..b2e07e77b56e 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/cassandraresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -261,8 +259,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -356,8 +353,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -545,8 +540,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -638,8 +632,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -733,8 +726,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -825,8 +817,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -916,8 +907,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1009,8 +999,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1105,8 +1094,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1201,8 +1189,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1299,8 +1286,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1397,8 +1383,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1504,8 +1489,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/collection.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/collection.go index 3987bdcaf495..85d3eb978398 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/collection.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartition.go index 8dcfb06c9d0b..da9f3f3bb097 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartition.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartitionregion.go index db22ad1002de..ddfe24088024 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartitionregion.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionregion.go index f603694e5150..2d8f654aabd8 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionregion.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/database.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/database.go index 0b9751516726..52adffd03513 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/database.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccountregion.go index 8e36d3ae4c0d..bdd552ee16fe 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccountregion.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccounts.go index 7e2656b72b5c..e6e9978f12bb 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/gremlinresources.go index 6ee0688a45c3..3130d3341f98 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/gremlinresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -363,8 +360,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -459,8 +455,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -552,8 +547,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -645,8 +639,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -740,8 +733,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -832,8 +824,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -923,8 +914,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1015,8 +1005,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1111,8 +1100,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1207,8 +1195,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1304,8 +1291,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1402,8 +1388,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1508,8 +1493,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/mongodbresources.go index 02d7694d7108..73a2ab84d357 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/mongodbresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -262,8 +260,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -357,8 +354,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -641,8 +635,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -734,8 +727,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -826,8 +818,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -917,8 +908,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1010,8 +1000,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1108,8 +1097,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1204,8 +1192,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1300,8 +1287,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1398,8 +1384,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1505,8 +1490,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/notebookworkspaces.go index 9cfba906c684..07a09c070ff0 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeid.go index a3f6123ef420..b10260f0ad83 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeid.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeidregion.go index 4bc1c6149a81..3fa952f0e9a7 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeidregion.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentile.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentile.go index 3dcd6e82da7e..7dfb88456618 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentile.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentilesourcetarget.go index 312c9ae31501..d34e328539c7 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentilesourcetarget.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentiletarget.go index de1e53bb4020..17dcd44d9024 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/percentiletarget.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/privateendpointconnections.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/privateendpointconnections.go index 8bcbe0c260b1..d402e8559ab3 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/privateendpointconnections.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/privatelinkresources.go index 917548d95eaa..97e6796cb7d1 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/privatelinkresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/sqlresources.go index c39efb11938c..b7f140e0c78e 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/sqlresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -165,8 +164,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -377,8 +374,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -485,8 +481,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -590,8 +585,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -685,8 +679,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -781,8 +774,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -879,8 +871,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -977,8 +968,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1074,8 +1064,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1169,8 +1158,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1262,8 +1250,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1355,8 +1342,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1449,8 +1435,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1545,8 +1530,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1641,8 +1625,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1735,8 +1718,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1826,8 +1808,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1918,8 +1899,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2012,8 +1992,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2106,8 +2085,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2200,8 +2178,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2297,8 +2274,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2393,8 +2369,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2488,8 +2463,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2585,8 +2559,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2691,8 +2664,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-01-15/documentdb/tableresources.go b/services/cosmos-db/mgmt/2021-01-15/documentdb/tableresources.go index c08c3f6bfbb7..7ba4b448fa7a 100644 --- a/services/cosmos-db/mgmt/2021-01-15/documentdb/tableresources.go +++ b/services/cosmos-db/mgmt/2021-01-15/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -155,8 +154,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -249,8 +247,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -342,8 +339,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -433,8 +429,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -524,8 +519,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -619,8 +613,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -715,8 +708,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-03-15/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-03-15/documentdb/_meta.json index ac3d5fb1e8f5..b71463397208 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "e0f8b9ab0f5fe5e71b7429ebfea8a33c19ec9d8d", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-03", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/cassandraresources.go index 39c147a4c2bd..1d1da900eb50 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/cassandraresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -261,8 +259,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -356,8 +353,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -545,8 +540,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -638,8 +632,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -733,8 +726,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -825,8 +817,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -916,8 +907,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1009,8 +999,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1105,8 +1094,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1201,8 +1189,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1299,8 +1286,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1397,8 +1383,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1504,8 +1489,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/collection.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/collection.go index e492e97d5fde..cfa6207a3d87 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/collection.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartition.go index 967955f1ee36..133b4e22049f 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartition.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartitionregion.go index c4fbd72a51d2..fc897ed2f7d6 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartitionregion.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionregion.go index c15cee334bba..512d740da95d 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionregion.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/database.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/database.go index 35314f4c6d0b..577b36200369 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/database.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccountregion.go index 6611338d3e03..dbec39b54ef7 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccountregion.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccounts.go index 9547e5af1ec6..2fb51b10118c 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/gremlinresources.go index 148518ed5a3a..418e1b645fe4 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/gremlinresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -363,8 +360,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -459,8 +455,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -552,8 +547,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -645,8 +639,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -740,8 +733,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -832,8 +824,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -923,8 +914,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1015,8 +1005,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1111,8 +1100,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1207,8 +1195,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1304,8 +1291,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1402,8 +1388,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1508,8 +1493,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/mongodbresources.go index 31fe7baa9786..5583a4b0f23f 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/mongodbresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -262,8 +260,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -357,8 +354,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -641,8 +635,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -734,8 +727,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -826,8 +818,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -917,8 +908,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1010,8 +1000,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1108,8 +1097,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1204,8 +1192,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1300,8 +1287,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1398,8 +1384,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1505,8 +1490,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/notebookworkspaces.go index da66252e48e6..9cb8432a7ceb 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeid.go index 920cf18c471d..4f900f6c5047 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeid.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeidregion.go index 27450edce417..5f5a7e81f73c 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeidregion.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentile.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentile.go index 96f1db10b283..8fcdb11453b2 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentile.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentilesourcetarget.go index 6d06ceacbc79..44e9c5a5a426 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentilesourcetarget.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentiletarget.go index 2227a7cc2bd8..731d1bf12cfb 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/percentiletarget.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/privateendpointconnections.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/privateendpointconnections.go index efaf4e6fdd3b..c56900f928ef 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/privateendpointconnections.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/privatelinkresources.go index 61ffd6143cc4..f25a72ca3945 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/privatelinkresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/sqlresources.go index 5052863869bc..1735ef9a22ea 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/sqlresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -165,8 +164,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -377,8 +374,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -485,8 +481,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -590,8 +585,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -685,8 +679,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -781,8 +774,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -879,8 +871,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -977,8 +968,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1074,8 +1064,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1169,8 +1158,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1262,8 +1250,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1355,8 +1342,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1449,8 +1435,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1545,8 +1530,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1641,8 +1625,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1735,8 +1718,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1826,8 +1808,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1918,8 +1899,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2012,8 +1992,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2106,8 +2085,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2200,8 +2178,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2297,8 +2274,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2393,8 +2369,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2488,8 +2463,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2585,8 +2559,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2691,8 +2664,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-03-15/documentdb/tableresources.go b/services/cosmos-db/mgmt/2021-03-15/documentdb/tableresources.go index 431a737f516a..7da6e65d9ed2 100644 --- a/services/cosmos-db/mgmt/2021-03-15/documentdb/tableresources.go +++ b/services/cosmos-db/mgmt/2021-03-15/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -155,8 +154,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -249,8 +247,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -342,8 +339,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -433,8 +429,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -524,8 +519,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -619,8 +613,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -715,8 +708,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-04-15/documentdb/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-04-15/documentdb/_meta.json new file mode 100644 index 000000000000..46896e034497 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", + "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", + "tag": "package-2021-04", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-04 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/cassandraresources.go new file mode 100644 index 000000000000..e0b69cf81bae --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/cassandraresources.go @@ -0,0 +1,1573 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CassandraResourcesClient is the client for the CassandraResources methods of the Documentdb service. +type CassandraResourcesClient struct { + BaseClient +} + +// NewCassandraResourcesClient creates an instance of the CassandraResourcesClient client. +func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { + return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCassandraResourcesClientWithBaseURI creates an instance of the CassandraResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { + return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateCassandraKeyspace create or update an Azure Cosmos DB Cassandra keyspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// createUpdateCassandraKeyspaceParameters - the parameters to provide for the current Cassandra keyspace. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraKeyspace") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateCassandraKeyspaceParameters, + Constraints: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", err.Error()) + } + + req, err := client.CreateUpdateCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateCassandraKeyspaceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateCassandraKeyspacePreparer prepares the CreateUpdateCassandraKeyspace request. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithJSON(createUpdateCassandraKeyspaceParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateCassandraKeyspaceSender sends the CreateUpdateCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateCassandraKeyspaceResponder handles the response to the CreateUpdateCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateCassandraTable create or update an Azure Cosmos DB Cassandra Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +// createUpdateCassandraTableParameters - the parameters to provide for the current Cassandra Table. +func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateCassandraTableParameters, + Constraints: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", err.Error()) + } + + req, err := client.CreateUpdateCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateCassandraTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateCassandraTablePreparer prepares the CreateUpdateCassandraTable request. +func (client CassandraResourcesClient) CreateUpdateCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithJSON(createUpdateCassandraTableParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateCassandraTableSender sends the CreateUpdateCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) CreateUpdateCassandraTableSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateCassandraTableResponder handles the response to the CreateUpdateCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) CreateUpdateCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCassandraKeyspace deletes an existing Azure Cosmos DB Cassandra keyspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesDeleteCassandraKeyspaceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraKeyspace") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", err.Error()) + } + + req, err := client.DeleteCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = client.DeleteCassandraKeyspaceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteCassandraKeyspacePreparer prepares the DeleteCassandraKeyspace request. +func (client CassandraResourcesClient) DeleteCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCassandraKeyspaceSender sends the DeleteCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) DeleteCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesDeleteCassandraKeyspaceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteCassandraKeyspaceResponder handles the response to the DeleteCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) DeleteCassandraKeyspaceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteCassandraTable deletes an existing Azure Cosmos DB Cassandra table. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesDeleteCassandraTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraTable", err.Error()) + } + + req, err := client.DeleteCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", nil, "Failure preparing request") + return + } + + result, err = client.DeleteCassandraTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteCassandraTablePreparer prepares the DeleteCassandraTable request. +func (client CassandraResourcesClient) DeleteCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCassandraTableSender sends the DeleteCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) DeleteCassandraTableSender(req *http.Request) (future CassandraResourcesDeleteCassandraTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteCassandraTableResponder handles the response to the DeleteCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) DeleteCassandraTableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetCassandraKeyspace gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the +// provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraKeyspaceGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspace", err.Error()) + } + + req, err := client.GetCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraKeyspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraKeyspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraKeyspacePreparer prepares the GetCassandraKeyspace request. +func (client CassandraResourcesClient) GetCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraKeyspaceSender sends the GetCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraKeyspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraKeyspaceResponder handles the response to the GetCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraKeyspaceThroughput gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspaceThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", err.Error()) + } + + req, err := client.GetCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraKeyspaceThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraKeyspaceThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraKeyspaceThroughputPreparer prepares the GetCassandraKeyspaceThroughput request. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraKeyspaceThroughputSender sends the GetCassandraKeyspaceThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraKeyspaceThroughputResponder handles the response to the GetCassandraKeyspaceThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraTable gets the Cassandra table under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraTableGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTable", err.Error()) + } + + req, err := client.GetCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraTableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraTablePreparer prepares the GetCassandraTable request. +func (client CassandraResourcesClient) GetCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraTableSender sends the GetCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraTableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraTableResponder handles the response to the GetCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraTableThroughput gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTableThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", err.Error()) + } + + req, err := client.GetCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraTableThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraTableThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraTableThroughputPreparer prepares the GetCassandraTableThroughput request. +func (client CassandraResourcesClient) GetCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraTableThroughputSender sends the GetCassandraTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraTableThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraTableThroughputResponder handles the response to the GetCassandraTableThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListCassandraKeyspaces lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result CassandraKeyspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraKeyspaces") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", err.Error()) + } + + req, err := client.ListCassandraKeyspacesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", nil, "Failure preparing request") + return + } + + resp, err := client.ListCassandraKeyspacesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure sending request") + return + } + + result, err = client.ListCassandraKeyspacesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure responding to request") + return + } + + return +} + +// ListCassandraKeyspacesPreparer prepares the ListCassandraKeyspaces request. +func (client CassandraResourcesClient) ListCassandraKeyspacesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCassandraKeyspacesSender sends the ListCassandraKeyspaces request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) ListCassandraKeyspacesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCassandraKeyspacesResponder handles the response to the ListCassandraKeyspaces request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) ListCassandraKeyspacesResponder(resp *http.Response) (result CassandraKeyspaceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListCassandraTables lists the Cassandra table under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraTableListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraTables") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraTables", err.Error()) + } + + req, err := client.ListCassandraTablesPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", nil, "Failure preparing request") + return + } + + resp, err := client.ListCassandraTablesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure sending request") + return + } + + result, err = client.ListCassandraTablesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure responding to request") + return + } + + return +} + +// ListCassandraTablesPreparer prepares the ListCassandraTables request. +func (client CassandraResourcesClient) ListCassandraTablesPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCassandraTablesSender sends the ListCassandraTables request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) ListCassandraTablesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCassandraTablesResponder handles the response to the ListCassandraTables request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) ListCassandraTablesResponder(resp *http.Response) (result CassandraTableListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraKeyspaceToAutoscale migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to +// autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", err.Error()) + } + + req, err := client.MigrateCassandraKeyspaceToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraKeyspaceToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraKeyspaceToAutoscalePreparer prepares the MigrateCassandraKeyspaceToAutoscale request. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraKeyspaceToAutoscaleSender sends the MigrateCassandraKeyspaceToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraKeyspaceToAutoscaleResponder handles the response to the MigrateCassandraKeyspaceToAutoscale request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraKeyspaceToManualThroughput migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", err.Error()) + } + + req, err := client.MigrateCassandraKeyspaceToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraKeyspaceToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraKeyspaceToManualThroughputPreparer prepares the MigrateCassandraKeyspaceToManualThroughput request. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraKeyspaceToManualThroughputSender sends the MigrateCassandraKeyspaceToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraKeyspaceToManualThroughputResponder handles the response to the MigrateCassandraKeyspaceToManualThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraTableToAutoscale migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", err.Error()) + } + + req, err := client.MigrateCassandraTableToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraTableToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraTableToAutoscalePreparer prepares the MigrateCassandraTableToAutoscale request. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraTableToAutoscaleSender sends the MigrateCassandraTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraTableToAutoscaleResponder handles the response to the MigrateCassandraTableToAutoscale request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraTableToManualThroughput migrate an Azure Cosmos DB Cassandra table from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", err.Error()) + } + + req, err := client.MigrateCassandraTableToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraTableToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraTableToManualThroughputPreparer prepares the MigrateCassandraTableToManualThroughput request. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraTableToManualThroughputSender sends the MigrateCassandraTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraTableToManualThroughputResponder handles the response to the MigrateCassandraTableToManualThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCassandraKeyspaceThroughput update RUs per second of an Azure Cosmos DB Cassandra Keyspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra +// Keyspace. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraKeyspaceThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", err.Error()) + } + + req, err := client.UpdateCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateCassandraKeyspaceThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateCassandraKeyspaceThroughputPreparer prepares the UpdateCassandraKeyspaceThroughput request. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCassandraKeyspaceThroughputSender sends the UpdateCassandraKeyspaceThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateCassandraKeyspaceThroughputResponder handles the response to the UpdateCassandraKeyspaceThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCassandraTableThroughput update RUs per second of an Azure Cosmos DB Cassandra table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra +// table. +func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraTableThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraTableThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", err.Error()) + } + + req, err := client.UpdateCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateCassandraTableThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateCassandraTableThroughputPreparer prepares the UpdateCassandraTableThroughput request. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCassandraTableThroughputSender sends the UpdateCassandraTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraTableThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateCassandraTableThroughputResponder handles the response to the UpdateCassandraTableThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/client.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/client.go new file mode 100644 index 000000000000..d2cdb0adaec8 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/client.go @@ -0,0 +1,41 @@ +// Package documentdb implements the Azure ARM Documentdb service API version 2021-04-15. +// +// +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Documentdb + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Documentdb. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/collection.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/collection.go new file mode 100644 index 000000000000..f2d379ef0017 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/collection.go @@ -0,0 +1,320 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionClient is the client for the Collection methods of the Documentdb service. +type CollectionClient struct { + BaseClient +} + +// NewCollectionClient creates an instance of the CollectionClient client. +func NewCollectionClient(subscriptionID string) CollectionClient { + return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionClientWithBaseURI creates an instance of the CollectionClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return CollectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetricDefinitions retrieves metric definitions for the given collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client CollectionClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent storage data) for the given collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client CollectionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartition.go new file mode 100644 index 000000000000..7bdc7a5007bd --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartition.go @@ -0,0 +1,228 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionPartitionClient is the client for the CollectionPartition methods of the Documentdb service. +type CollectionPartitionClient struct { + BaseClient +} + +// NewCollectionPartitionClient creates an instance of the CollectionPartitionClient client. +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionClientWithBaseURI creates an instance of the CollectionPartitionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent storage data) for the given collection, split by partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client CollectionPartitionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionUsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client CollectionPartitionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListUsagesResponder(resp *http.Response) (result PartitionUsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartitionregion.go new file mode 100644 index 000000000000..354783b0a5fa --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionpartitionregion.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionPartitionRegionClient is the client for the CollectionPartitionRegion methods of the Documentdb service. +type CollectionPartitionRegionClient struct { + BaseClient +} + +// NewCollectionPartitionRegionClient creates an instance of the CollectionPartitionRegionClient client. +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionRegionClientWithBaseURI creates an instance of the CollectionPartitionRegionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by +// partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionregion.go new file mode 100644 index 000000000000..3e4134d79380 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/collectionregion.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionRegionClient is the client for the CollectionRegion methods of the Documentdb service. +type CollectionRegionClient struct { + BaseClient +} + +// NewCollectionRegionClient creates an instance of the CollectionRegionClient client. +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionRegionClientWithBaseURI creates an instance of the CollectionRegionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and +// region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionRegionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/database.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/database.go new file mode 100644 index 000000000000..446874508d91 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/database.go @@ -0,0 +1,314 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseClient is the client for the Database methods of the Documentdb service. +type DatabaseClient struct { + BaseClient +} + +// NewDatabaseClient creates an instance of the DatabaseClient client. +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseClientWithBaseURI creates an instance of the DatabaseClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetricDefinitions retrieves metric definitions for the given database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client DatabaseClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent data) for the given database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client DatabaseClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccountregion.go new file mode 100644 index 000000000000..91eab88625fb --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccountregion.go @@ -0,0 +1,128 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseAccountRegionClient is the client for the DatabaseAccountRegion methods of the Documentdb service. +type DatabaseAccountRegionClient struct { + BaseClient +} + +// NewDatabaseAccountRegionClient creates an instance of the DatabaseAccountRegionClient client. +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseAccountRegionClientWithBaseURI creates an instance of the DatabaseAccountRegionClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseAccountRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseAccountRegionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccounts.go new file mode 100644 index 000000000000..b431b877f20d --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/databaseaccounts.go @@ -0,0 +1,1676 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseAccountsClient is the client for the DatabaseAccounts methods of the Documentdb service. +type DatabaseAccountsClient struct { + BaseClient +} + +// NewDatabaseAccountsClient creates an instance of the DatabaseAccountsClient client. +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseAccountsClientWithBaseURI creates an instance of the DatabaseAccountsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only +// lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. +// Parameters: +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) CheckNameExists(ctx context.Context, accountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CheckNameExists") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CheckNameExists", err.Error()) + } + + req, err := client.CheckNameExistsPreparer(ctx, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", resp, "Failure sending request") + return + } + + result, err = client.CheckNameExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameExistsPreparer prepares the CheckNameExists request. +func (client DatabaseAccountsClient) CheckNameExistsPreparer(ctx context.Context, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameExistsSender sends the CheckNameExists request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) CheckNameExistsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckNameExistsResponder handles the response to the CheckNameExists request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) CheckNameExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when +// performing updates on an account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateParameters - the parameters to provide for the current database account. +func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters) (result DatabaseAccountsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateParameters, + Constraints: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMaximum, Rule: int64(2147483647), Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMaximum, Rule: int64(86400), Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, + }}, + }}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.Locations", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.DatabaseAccountOfferType", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, createUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabaseAccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithJSON(createUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) CreateOrUpdateSender(req *http.Request) (future DatabaseAccountsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatabaseAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) DeleteSender(req *http.Request) (future DatabaseAccountsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverPriorityChange changes the failover priority for the Azure Cosmos DB database account. A failover priority +// of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover +// priority values must be unique for each of the regions in which the database account exists. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// failoverParameters - the new failover policies for the database account. +func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies) (result DatabaseAccountsFailoverPriorityChangeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.FailoverPriorityChange") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: failoverParameters, + Constraints: []validation.Constraint{{Target: "failoverParameters.FailoverPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "FailoverPriorityChange", err.Error()) + } + + req, err := client.FailoverPriorityChangePreparer(ctx, resourceGroupName, accountName, failoverParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "FailoverPriorityChange", nil, "Failure preparing request") + return + } + + result, err = client.FailoverPriorityChangeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "FailoverPriorityChange", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverPriorityChangePreparer prepares the FailoverPriorityChange request. +func (client DatabaseAccountsClient) FailoverPriorityChangePreparer(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", pathParameters), + autorest.WithJSON(failoverParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverPriorityChangeSender sends the FailoverPriorityChange request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) FailoverPriorityChangeSender(req *http.Request) (future DatabaseAccountsFailoverPriorityChangeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverPriorityChangeResponder handles the response to the FailoverPriorityChange request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) FailoverPriorityChangeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the properties of an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabaseAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) GetResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetReadOnlyKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", err.Error()) + } + + req, err := client.GetReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetReadOnlyKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure sending request") + return + } + + result, err = client.GetReadOnlyKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure responding to request") + return + } + + return +} + +// GetReadOnlyKeysPreparer prepares the GetReadOnlyKeys request. +func (client DatabaseAccountsClient) GetReadOnlyKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReadOnlyKeysSender sends the GetReadOnlyKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) GetReadOnlyKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetReadOnlyKeysResponder handles the response to the GetReadOnlyKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) GetReadOnlyKeysResponder(resp *http.Response) (result DatabaseAccountListReadOnlyKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the Azure Cosmos DB database accounts available under the subscription. +func (client DatabaseAccountsClient) List(ctx context.Context) (result DatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DatabaseAccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListResponder(resp *http.Response) (result DatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all the Azure Cosmos DB database accounts available under the given resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DatabaseAccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result DatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionStrings lists the connection strings for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListConnectionStringsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListConnectionStrings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListConnectionStrings", err.Error()) + } + + req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionStringsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionStringsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionStringsPreparer prepares the ListConnectionStrings request. +func (client DatabaseAccountsClient) ListConnectionStringsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListConnectionStringsResponder(resp *http.Response) (result DatabaseAccountListConnectionStringsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListKeys lists the access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client DatabaseAccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListKeysResponder(resp *http.Response) (result DatabaseAccountListKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetricDefinitions retrieves metric definitions for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client DatabaseAccountsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseAccountsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListReadOnlyKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", err.Error()) + } + + req, err := client.ListReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListReadOnlyKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", resp, "Failure sending request") + return + } + + result, err = client.ListReadOnlyKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListReadOnlyKeysPreparer prepares the ListReadOnlyKeys request. +func (client DatabaseAccountsClient) ListReadOnlyKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListReadOnlyKeysSender sends the ListReadOnlyKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListReadOnlyKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListReadOnlyKeysResponder handles the response to the ListReadOnlyKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListReadOnlyKeysResponder(resp *http.Response) (result DatabaseAccountListReadOnlyKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent data) for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client DatabaseAccountsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// OfflineRegion offline the specified region for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// regionParameterForOffline - cosmos DB region to offline for the database account. +func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline) (result DatabaseAccountsOfflineRegionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.OfflineRegion") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: regionParameterForOffline, + Constraints: []validation.Constraint{{Target: "regionParameterForOffline.Region", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "OfflineRegion", err.Error()) + } + + req, err := client.OfflineRegionPreparer(ctx, resourceGroupName, accountName, regionParameterForOffline) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OfflineRegion", nil, "Failure preparing request") + return + } + + result, err = client.OfflineRegionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OfflineRegion", result.Response(), "Failure sending request") + return + } + + return +} + +// OfflineRegionPreparer prepares the OfflineRegion request. +func (client DatabaseAccountsClient) OfflineRegionPreparer(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion", pathParameters), + autorest.WithJSON(regionParameterForOffline), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// OfflineRegionSender sends the OfflineRegion request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) OfflineRegionSender(req *http.Request) (future DatabaseAccountsOfflineRegionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// OfflineRegionResponder handles the response to the OfflineRegion request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) OfflineRegionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// OnlineRegion online the specified region for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// regionParameterForOnline - cosmos DB region to online for the database account. +func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline) (result DatabaseAccountsOnlineRegionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.OnlineRegion") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: regionParameterForOnline, + Constraints: []validation.Constraint{{Target: "regionParameterForOnline.Region", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "OnlineRegion", err.Error()) + } + + req, err := client.OnlineRegionPreparer(ctx, resourceGroupName, accountName, regionParameterForOnline) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OnlineRegion", nil, "Failure preparing request") + return + } + + result, err = client.OnlineRegionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OnlineRegion", result.Response(), "Failure sending request") + return + } + + return +} + +// OnlineRegionPreparer prepares the OnlineRegion request. +func (client DatabaseAccountsClient) OnlineRegionPreparer(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion", pathParameters), + autorest.WithJSON(regionParameterForOnline), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// OnlineRegionSender sends the OnlineRegion request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) OnlineRegionSender(req *http.Request) (future DatabaseAccountsOnlineRegionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// OnlineRegionResponder handles the response to the OnlineRegion request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) OnlineRegionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateKey regenerates an access key for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyToRegenerate - the name of the key to regenerate. +func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters) (result DatabaseAccountsRegenerateKeyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.RegenerateKey") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, keyToRegenerate) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + result, err = client.RegenerateKeySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "RegenerateKey", result.Response(), "Failure sending request") + return + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client DatabaseAccountsClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", pathParameters), + autorest.WithJSON(keyToRegenerate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) RegenerateKeySender(req *http.Request) (future DatabaseAccountsRegenerateKeyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) RegenerateKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates the properties of an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// updateParameters - the parameters to provide for the current database account. +func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters) (result DatabaseAccountsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, updateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DatabaseAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithJSON(updateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) UpdateSender(req *http.Request) (future DatabaseAccountsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) UpdateResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/documentdbapi/interfaces.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/documentdbapi/interfaces.go new file mode 100644 index 000000000000..01319247e9be --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/documentdbapi/interfaces.go @@ -0,0 +1,280 @@ +package documentdbapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-04-15/documentdb" + "github.com/Azure/go-autorest/autorest" +) + +// DatabaseAccountsClientAPI contains the set of methods on the DatabaseAccountsClient type. +type DatabaseAccountsClientAPI interface { + CheckNameExists(ctx context.Context, accountName string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters documentdb.DatabaseAccountCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountsDeleteFuture, err error) + FailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters documentdb.FailoverPolicies) (result documentdb.DatabaseAccountsFailoverPriorityChangeFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountGetResults, err error) + GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) + List(ctx context.Context) (result documentdb.DatabaseAccountsListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result documentdb.DatabaseAccountsListResult, err error) + ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListConnectionStringsResult, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListKeysResult, err error) + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.MetricListResult, err error) + ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.UsagesResult, err error) + OfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline documentdb.RegionForOnlineOffline) (result documentdb.DatabaseAccountsOfflineRegionFuture, err error) + OnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline documentdb.RegionForOnlineOffline) (result documentdb.DatabaseAccountsOnlineRegionFuture, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate documentdb.DatabaseAccountRegenerateKeyParameters) (result documentdb.DatabaseAccountsRegenerateKeyFuture, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, updateParameters documentdb.DatabaseAccountUpdateParameters) (result documentdb.DatabaseAccountsUpdateFuture, err error) +} + +var _ DatabaseAccountsClientAPI = (*documentdb.DatabaseAccountsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result documentdb.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result documentdb.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*documentdb.OperationsClient)(nil) + +// DatabaseClientAPI contains the set of methods on the DatabaseClient type. +type DatabaseClientAPI interface { + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result documentdb.MetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result documentdb.UsagesResult, err error) +} + +var _ DatabaseClientAPI = (*documentdb.DatabaseClient)(nil) + +// CollectionClientAPI contains the set of methods on the CollectionClient type. +type CollectionClientAPI interface { + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.MetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.UsagesResult, err error) +} + +var _ CollectionClientAPI = (*documentdb.CollectionClient)(nil) + +// CollectionRegionClientAPI contains the set of methods on the CollectionRegionClient type. +type CollectionRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result documentdb.MetricListResult, err error) +} + +var _ CollectionRegionClientAPI = (*documentdb.CollectionRegionClient)(nil) + +// DatabaseAccountRegionClientAPI contains the set of methods on the DatabaseAccountRegionClient type. +type DatabaseAccountRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (result documentdb.MetricListResult, err error) +} + +var _ DatabaseAccountRegionClientAPI = (*documentdb.DatabaseAccountRegionClient)(nil) + +// PercentileSourceTargetClientAPI contains the set of methods on the PercentileSourceTargetClient type. +type PercentileSourceTargetClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileSourceTargetClientAPI = (*documentdb.PercentileSourceTargetClient)(nil) + +// PercentileTargetClientAPI contains the set of methods on the PercentileTargetClient type. +type PercentileTargetClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileTargetClientAPI = (*documentdb.PercentileTargetClient)(nil) + +// PercentileClientAPI contains the set of methods on the PercentileClient type. +type PercentileClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileClientAPI = (*documentdb.PercentileClient)(nil) + +// CollectionPartitionRegionClientAPI contains the set of methods on the CollectionPartitionRegionClient type. +type CollectionPartitionRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ CollectionPartitionRegionClientAPI = (*documentdb.CollectionPartitionRegionClient)(nil) + +// CollectionPartitionClientAPI contains the set of methods on the CollectionPartitionClient type. +type CollectionPartitionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionMetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionUsagesResult, err error) +} + +var _ CollectionPartitionClientAPI = (*documentdb.CollectionPartitionClient)(nil) + +// PartitionKeyRangeIDClientAPI contains the set of methods on the PartitionKeyRangeIDClient type. +type PartitionKeyRangeIDClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ PartitionKeyRangeIDClientAPI = (*documentdb.PartitionKeyRangeIDClient)(nil) + +// PartitionKeyRangeIDRegionClientAPI contains the set of methods on the PartitionKeyRangeIDRegionClient type. +type PartitionKeyRangeIDRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ PartitionKeyRangeIDRegionClientAPI = (*documentdb.PartitionKeyRangeIDRegionClient)(nil) + +// SQLResourcesClientAPI contains the set of methods on the SQLResourcesClient type. +type SQLResourcesClientAPI interface { + CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters documentdb.SQLContainerCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLContainerFuture, err error) + CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters documentdb.SQLDatabaseCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture, err error) + CreateUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters documentdb.SQLRoleAssignmentCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) + CreateUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters documentdb.SQLRoleDefinitionCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) + CreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters documentdb.SQLStoredProcedureCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) + CreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters documentdb.SQLTriggerCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLTriggerFuture, err error) + CreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters documentdb.SQLUserDefinedFunctionCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) + DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesDeleteSQLContainerFuture, err error) + DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesDeleteSQLDatabaseFuture, err error) + DeleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture, err error) + DeleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture, err error) + DeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result documentdb.SQLResourcesDeleteSQLStoredProcedureFuture, err error) + DeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result documentdb.SQLResourcesDeleteSQLTriggerFuture, err error) + DeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) + GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLContainerGetResults, err error) + GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLDatabaseGetResults, err error) + GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result documentdb.SQLRoleAssignmentGetResults, err error) + GetSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result documentdb.SQLRoleDefinitionGetResults, err error) + GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result documentdb.SQLStoredProcedureGetResults, err error) + GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result documentdb.SQLTriggerGetResults, err error) + GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result documentdb.SQLUserDefinedFunctionGetResults, err error) + ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLContainerListResult, err error) + ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLDatabaseListResult, err error) + ListSQLRoleAssignments(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLRoleAssignmentListResult, err error) + ListSQLRoleDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLRoleDefinitionListResult, err error) + ListSQLStoredProcedures(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLStoredProcedureListResult, err error) + ListSQLTriggers(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLTriggerListResult, err error) + ListSQLUserDefinedFunctions(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLUserDefinedFunctionListResult, err error) + MigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) + MigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) + MigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) + MigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) + UpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.SQLResourcesUpdateSQLContainerThroughputFuture, err error) + UpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) +} + +var _ SQLResourcesClientAPI = (*documentdb.SQLResourcesClient)(nil) + +// MongoDBResourcesClientAPI contains the set of methods on the MongoDBResourcesClient type. +type MongoDBResourcesClientAPI interface { + CreateUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters documentdb.MongoDBCollectionCreateUpdateParameters) (result documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) + CreateUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters documentdb.MongoDBDatabaseCreateUpdateParameters) (result documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) + DeleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture, err error) + DeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) + GetMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBCollectionGetResults, err error) + GetMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBDatabaseGetResults, err error) + GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListMongoDBCollections(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBCollectionListResult, err error) + ListMongoDBDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MongoDBDatabaseListResult, err error) + MigrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) + MigrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) + MigrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) + MigrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) + UpdateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) + UpdateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) +} + +var _ MongoDBResourcesClientAPI = (*documentdb.MongoDBResourcesClient)(nil) + +// TableResourcesClientAPI contains the set of methods on the TableResourcesClient type. +type TableResourcesClientAPI interface { + CreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters documentdb.TableCreateUpdateParameters) (result documentdb.TableResourcesCreateUpdateTableFuture, err error) + DeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesDeleteTableFuture, err error) + GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableGetResults, err error) + GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListTables(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.TableListResult, err error) + MigrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesMigrateTableToAutoscaleFuture, err error) + MigrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesMigrateTableToManualThroughputFuture, err error) + UpdateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.TableResourcesUpdateTableThroughputFuture, err error) +} + +var _ TableResourcesClientAPI = (*documentdb.TableResourcesClient)(nil) + +// CassandraResourcesClientAPI contains the set of methods on the CassandraResourcesClient type. +type CassandraResourcesClientAPI interface { + CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters documentdb.CassandraKeyspaceCreateUpdateParameters) (result documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) + CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters documentdb.CassandraTableCreateUpdateParameters) (result documentdb.CassandraResourcesCreateUpdateCassandraTableFuture, err error) + DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture, err error) + DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesDeleteCassandraTableFuture, err error) + GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraKeyspaceGetResults, err error) + GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraTableGetResults, err error) + GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.CassandraKeyspaceListResult, err error) + ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraTableListResult, err error) + MigrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) + MigrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) + MigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) + MigrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) + UpdateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) + UpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture, err error) +} + +var _ CassandraResourcesClientAPI = (*documentdb.CassandraResourcesClient)(nil) + +// GremlinResourcesClientAPI contains the set of methods on the GremlinResourcesClient type. +type GremlinResourcesClientAPI interface { + CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters documentdb.GremlinDatabaseCreateUpdateParameters) (result documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) + CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters documentdb.GremlinGraphCreateUpdateParameters) (result documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture, err error) + DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesDeleteGremlinDatabaseFuture, err error) + DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesDeleteGremlinGraphFuture, err error) + GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinDatabaseGetResults, err error) + GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinGraphGetResults, err error) + GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.GremlinDatabaseListResult, err error) + ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinGraphListResult, err error) + MigrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) + MigrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) + MigrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) + MigrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) + UpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) + UpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) +} + +var _ GremlinResourcesClientAPI = (*documentdb.GremlinResourcesClient)(nil) + +// NotebookWorkspacesClientAPI contains the set of methods on the NotebookWorkspacesClient type. +type NotebookWorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters documentdb.NotebookWorkspaceCreateUpdateParameters) (result documentdb.NotebookWorkspacesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspace, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspaceListResult, err error) + ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspaceConnectionInfoResult, err error) + RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesRegenerateAuthTokenFuture, err error) + Start(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesStartFuture, err error) +} + +var _ NotebookWorkspacesClientAPI = (*documentdb.NotebookWorkspacesClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result documentdb.PrivateLinkResource, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*documentdb.PrivateLinkResourcesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters documentdb.PrivateEndpointConnection) (result documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result documentdb.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result documentdb.PrivateEndpointConnection, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.PrivateEndpointConnectionListResult, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*documentdb.PrivateEndpointConnectionsClient)(nil) diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/enums.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/enums.go new file mode 100644 index 000000000000..9f2f018f619d --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/enums.go @@ -0,0 +1,410 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BackupPolicyType enumerates the values for backup policy type. +type BackupPolicyType string + +const ( + // Continuous ... + Continuous BackupPolicyType = "Continuous" + // Periodic ... + Periodic BackupPolicyType = "Periodic" +) + +// PossibleBackupPolicyTypeValues returns an array of possible values for the BackupPolicyType const type. +func PossibleBackupPolicyTypeValues() []BackupPolicyType { + return []BackupPolicyType{Continuous, Periodic} +} + +// CompositePathSortOrder enumerates the values for composite path sort order. +type CompositePathSortOrder string + +const ( + // Ascending ... + Ascending CompositePathSortOrder = "ascending" + // Descending ... + Descending CompositePathSortOrder = "descending" +) + +// PossibleCompositePathSortOrderValues returns an array of possible values for the CompositePathSortOrder const type. +func PossibleCompositePathSortOrderValues() []CompositePathSortOrder { + return []CompositePathSortOrder{Ascending, Descending} +} + +// ConflictResolutionMode enumerates the values for conflict resolution mode. +type ConflictResolutionMode string + +const ( + // Custom ... + Custom ConflictResolutionMode = "Custom" + // LastWriterWins ... + LastWriterWins ConflictResolutionMode = "LastWriterWins" +) + +// PossibleConflictResolutionModeValues returns an array of possible values for the ConflictResolutionMode const type. +func PossibleConflictResolutionModeValues() []ConflictResolutionMode { + return []ConflictResolutionMode{Custom, LastWriterWins} +} + +// ConnectorOffer enumerates the values for connector offer. +type ConnectorOffer string + +const ( + // Small ... + Small ConnectorOffer = "Small" +) + +// PossibleConnectorOfferValues returns an array of possible values for the ConnectorOffer const type. +func PossibleConnectorOfferValues() []ConnectorOffer { + return []ConnectorOffer{Small} +} + +// DatabaseAccountKind enumerates the values for database account kind. +type DatabaseAccountKind string + +const ( + // GlobalDocumentDB ... + GlobalDocumentDB DatabaseAccountKind = "GlobalDocumentDB" + // MongoDB ... + MongoDB DatabaseAccountKind = "MongoDB" + // Parse ... + Parse DatabaseAccountKind = "Parse" +) + +// PossibleDatabaseAccountKindValues returns an array of possible values for the DatabaseAccountKind const type. +func PossibleDatabaseAccountKindValues() []DatabaseAccountKind { + return []DatabaseAccountKind{GlobalDocumentDB, MongoDB, Parse} +} + +// DatabaseAccountOfferType enumerates the values for database account offer type. +type DatabaseAccountOfferType string + +const ( + // Standard ... + Standard DatabaseAccountOfferType = "Standard" +) + +// PossibleDatabaseAccountOfferTypeValues returns an array of possible values for the DatabaseAccountOfferType const type. +func PossibleDatabaseAccountOfferTypeValues() []DatabaseAccountOfferType { + return []DatabaseAccountOfferType{Standard} +} + +// DataType enumerates the values for data type. +type DataType string + +const ( + // LineString ... + LineString DataType = "LineString" + // MultiPolygon ... + MultiPolygon DataType = "MultiPolygon" + // Number ... + Number DataType = "Number" + // Point ... + Point DataType = "Point" + // Polygon ... + Polygon DataType = "Polygon" + // String ... + String DataType = "String" +) + +// PossibleDataTypeValues returns an array of possible values for the DataType const type. +func PossibleDataTypeValues() []DataType { + return []DataType{LineString, MultiPolygon, Number, Point, Polygon, String} +} + +// DefaultConsistencyLevel enumerates the values for default consistency level. +type DefaultConsistencyLevel string + +const ( + // BoundedStaleness ... + BoundedStaleness DefaultConsistencyLevel = "BoundedStaleness" + // ConsistentPrefix ... + ConsistentPrefix DefaultConsistencyLevel = "ConsistentPrefix" + // Eventual ... + Eventual DefaultConsistencyLevel = "Eventual" + // Session ... + Session DefaultConsistencyLevel = "Session" + // Strong ... + Strong DefaultConsistencyLevel = "Strong" +) + +// PossibleDefaultConsistencyLevelValues returns an array of possible values for the DefaultConsistencyLevel const type. +func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { + return []DefaultConsistencyLevel{BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong} +} + +// IndexingMode enumerates the values for indexing mode. +type IndexingMode string + +const ( + // Consistent ... + Consistent IndexingMode = "consistent" + // Lazy ... + Lazy IndexingMode = "lazy" + // None ... + None IndexingMode = "none" +) + +// PossibleIndexingModeValues returns an array of possible values for the IndexingMode const type. +func PossibleIndexingModeValues() []IndexingMode { + return []IndexingMode{Consistent, Lazy, None} +} + +// IndexKind enumerates the values for index kind. +type IndexKind string + +const ( + // Hash ... + Hash IndexKind = "Hash" + // Range ... + Range IndexKind = "Range" + // Spatial ... + Spatial IndexKind = "Spatial" +) + +// PossibleIndexKindValues returns an array of possible values for the IndexKind const type. +func PossibleIndexKindValues() []IndexKind { + return []IndexKind{Hash, Range, Spatial} +} + +// KeyKind enumerates the values for key kind. +type KeyKind string + +const ( + // Primary ... + Primary KeyKind = "primary" + // PrimaryReadonly ... + PrimaryReadonly KeyKind = "primaryReadonly" + // Secondary ... + Secondary KeyKind = "secondary" + // SecondaryReadonly ... + SecondaryReadonly KeyKind = "secondaryReadonly" +) + +// PossibleKeyKindValues returns an array of possible values for the KeyKind const type. +func PossibleKeyKindValues() []KeyKind { + return []KeyKind{Primary, PrimaryReadonly, Secondary, SecondaryReadonly} +} + +// NetworkACLBypass enumerates the values for network acl bypass. +type NetworkACLBypass string + +const ( + // NetworkACLBypassAzureServices ... + NetworkACLBypassAzureServices NetworkACLBypass = "AzureServices" + // NetworkACLBypassNone ... + NetworkACLBypassNone NetworkACLBypass = "None" +) + +// PossibleNetworkACLBypassValues returns an array of possible values for the NetworkACLBypass const type. +func PossibleNetworkACLBypassValues() []NetworkACLBypass { + return []NetworkACLBypass{NetworkACLBypassAzureServices, NetworkACLBypassNone} +} + +// PartitionKind enumerates the values for partition kind. +type PartitionKind string + +const ( + // PartitionKindHash ... + PartitionKindHash PartitionKind = "Hash" + // PartitionKindMultiHash ... + PartitionKindMultiHash PartitionKind = "MultiHash" + // PartitionKindRange ... + PartitionKindRange PartitionKind = "Range" +) + +// PossiblePartitionKindValues returns an array of possible values for the PartitionKind const type. +func PossiblePartitionKindValues() []PartitionKind { + return []PartitionKind{PartitionKindHash, PartitionKindMultiHash, PartitionKindRange} +} + +// PrimaryAggregationType enumerates the values for primary aggregation type. +type PrimaryAggregationType string + +const ( + // PrimaryAggregationTypeAverage ... + PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" + // PrimaryAggregationTypeLast ... + PrimaryAggregationTypeLast PrimaryAggregationType = "Last" + // PrimaryAggregationTypeMaximum ... + PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" + // PrimaryAggregationTypeMinimum ... + PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" + // PrimaryAggregationTypeNone ... + PrimaryAggregationTypeNone PrimaryAggregationType = "None" + // PrimaryAggregationTypeTotal ... + PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" +) + +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeLast, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned,UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RoleDefinitionType enumerates the values for role definition type. +type RoleDefinitionType string + +const ( + // BuiltInRole ... + BuiltInRole RoleDefinitionType = "BuiltInRole" + // CustomRole ... + CustomRole RoleDefinitionType = "CustomRole" +) + +// PossibleRoleDefinitionTypeValues returns an array of possible values for the RoleDefinitionType const type. +func PossibleRoleDefinitionTypeValues() []RoleDefinitionType { + return []RoleDefinitionType{BuiltInRole, CustomRole} +} + +// ServerVersion enumerates the values for server version. +type ServerVersion string + +const ( + // FourFullStopZero ... + FourFullStopZero ServerVersion = "4.0" + // ThreeFullStopSix ... + ThreeFullStopSix ServerVersion = "3.6" + // ThreeFullStopTwo ... + ThreeFullStopTwo ServerVersion = "3.2" +) + +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{FourFullStopZero, ThreeFullStopSix, ThreeFullStopTwo} +} + +// SpatialType enumerates the values for spatial type. +type SpatialType string + +const ( + // SpatialTypeLineString ... + SpatialTypeLineString SpatialType = "LineString" + // SpatialTypeMultiPolygon ... + SpatialTypeMultiPolygon SpatialType = "MultiPolygon" + // SpatialTypePoint ... + SpatialTypePoint SpatialType = "Point" + // SpatialTypePolygon ... + SpatialTypePolygon SpatialType = "Polygon" +) + +// PossibleSpatialTypeValues returns an array of possible values for the SpatialType const type. +func PossibleSpatialTypeValues() []SpatialType { + return []SpatialType{SpatialTypeLineString, SpatialTypeMultiPolygon, SpatialTypePoint, SpatialTypePolygon} +} + +// TriggerOperation enumerates the values for trigger operation. +type TriggerOperation string + +const ( + // All ... + All TriggerOperation = "All" + // Create ... + Create TriggerOperation = "Create" + // Delete ... + Delete TriggerOperation = "Delete" + // Replace ... + Replace TriggerOperation = "Replace" + // Update ... + Update TriggerOperation = "Update" +) + +// PossibleTriggerOperationValues returns an array of possible values for the TriggerOperation const type. +func PossibleTriggerOperationValues() []TriggerOperation { + return []TriggerOperation{All, Create, Delete, Replace, Update} +} + +// TriggerType enumerates the values for trigger type. +type TriggerType string + +const ( + // Post ... + Post TriggerType = "Post" + // Pre ... + Pre TriggerType = "Pre" +) + +// PossibleTriggerTypeValues returns an array of possible values for the TriggerType const type. +func PossibleTriggerTypeValues() []TriggerType { + return []TriggerType{Post, Pre} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeBackupPolicy ... + TypeBackupPolicy Type = "BackupPolicy" + // TypeContinuous ... + TypeContinuous Type = "Continuous" + // TypePeriodic ... + TypePeriodic Type = "Periodic" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeBackupPolicy, TypeContinuous, TypePeriodic} +} + +// UnitType enumerates the values for unit type. +type UnitType string + +const ( + // Bytes ... + Bytes UnitType = "Bytes" + // BytesPerSecond ... + BytesPerSecond UnitType = "BytesPerSecond" + // Count ... + Count UnitType = "Count" + // CountPerSecond ... + CountPerSecond UnitType = "CountPerSecond" + // Milliseconds ... + Milliseconds UnitType = "Milliseconds" + // Percent ... + Percent UnitType = "Percent" + // Seconds ... + Seconds UnitType = "Seconds" +) + +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, Percent, Seconds} +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/gremlinresources.go new file mode 100644 index 000000000000..f365ec3b23ff --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/gremlinresources.go @@ -0,0 +1,1577 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GremlinResourcesClient is the client for the GremlinResources methods of the Documentdb service. +type GremlinResourcesClient struct { + BaseClient +} + +// NewGremlinResourcesClient creates an instance of the GremlinResourcesClient client. +func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { + return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGremlinResourcesClientWithBaseURI creates an instance of the GremlinResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { + return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateGremlinDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", err.Error()) + } + + req, err := client.CreateUpdateGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateGremlinDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateGremlinDatabasePreparer prepares the CreateUpdateGremlinDatabase request. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateGremlinDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateGremlinDatabaseSender sends the CreateUpdateGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateGremlinDatabaseResponder handles the response to the CreateUpdateGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateGremlinGraph create or update an Azure Cosmos DB Gremlin graph +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +// createUpdateGremlinGraphParameters - the parameters to provide for the current Gremlin graph. +func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinGraphFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinGraph") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateGremlinGraphParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, + {Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", err.Error()) + } + + req, err := client.CreateUpdateGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateGremlinGraphSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateGremlinGraphPreparer prepares the CreateUpdateGremlinGraph request. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithJSON(createUpdateGremlinGraphParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateGremlinGraphSender sends the CreateUpdateGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinGraphFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateGremlinGraphResponder handles the response to the CreateUpdateGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesDeleteGremlinDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", err.Error()) + } + + req, err := client.DeleteGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteGremlinDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteGremlinDatabasePreparer prepares the DeleteGremlinDatabase request. +func (client GremlinResourcesClient) DeleteGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteGremlinDatabaseSender sends the DeleteGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) DeleteGremlinDatabaseSender(req *http.Request) (future GremlinResourcesDeleteGremlinDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteGremlinDatabaseResponder handles the response to the DeleteGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) DeleteGremlinDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteGremlinGraph deletes an existing Azure Cosmos DB Gremlin graph. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesDeleteGremlinGraphFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinGraph") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinGraph", err.Error()) + } + + req, err := client.DeleteGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = client.DeleteGremlinGraphSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteGremlinGraphPreparer prepares the DeleteGremlinGraph request. +func (client GremlinResourcesClient) DeleteGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteGremlinGraphSender sends the DeleteGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) DeleteGremlinGraphSender(req *http.Request) (future GremlinResourcesDeleteGremlinGraphFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteGremlinGraphResponder handles the response to the DeleteGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) DeleteGremlinGraphResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided +// name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabase", err.Error()) + } + + req, err := client.GetGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinDatabasePreparer prepares the GetGremlinDatabase request. +func (client GremlinResourcesClient) GetGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinDatabaseSender sends the GetGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinDatabaseResponder handles the response to the GetGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinDatabaseThroughput gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", err.Error()) + } + + req, err := client.GetGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinDatabaseThroughputPreparer prepares the GetGremlinDatabaseThroughput request. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinDatabaseThroughputSender sends the GetGremlinDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinDatabaseThroughputResponder handles the response to the GetGremlinDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinGraph gets the Gremlin graph under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinGraphGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraph") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraph", err.Error()) + } + + req, err := client.GetGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinGraphSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinGraphResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinGraphPreparer prepares the GetGremlinGraph request. +func (client GremlinResourcesClient) GetGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinGraphSender sends the GetGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinGraphSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinGraphResponder handles the response to the GetGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinGraphThroughput gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with +// the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraphThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", err.Error()) + } + + req, err := client.GetGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinGraphThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinGraphThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinGraphThroughputPreparer prepares the GetGremlinGraphThroughput request. +func (client GremlinResourcesClient) GetGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinGraphThroughputSender sends the GetGremlinGraphThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinGraphThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinGraphThroughputResponder handles the response to the GetGremlinGraphThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinDatabases", err.Error()) + } + + req, err := client.ListGremlinDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListGremlinDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListGremlinDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListGremlinDatabasesPreparer prepares the ListGremlinDatabases request. +func (client GremlinResourcesClient) ListGremlinDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGremlinDatabasesSender sends the ListGremlinDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) ListGremlinDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGremlinDatabasesResponder handles the response to the ListGremlinDatabases request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) ListGremlinDatabasesResponder(resp *http.Response) (result GremlinDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGremlinGraphs lists the Gremlin graph under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinGraphListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinGraphs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinGraphs", err.Error()) + } + + req, err := client.ListGremlinGraphsPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", nil, "Failure preparing request") + return + } + + resp, err := client.ListGremlinGraphsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure sending request") + return + } + + result, err = client.ListGremlinGraphsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure responding to request") + return + } + + return +} + +// ListGremlinGraphsPreparer prepares the ListGremlinGraphs request. +func (client GremlinResourcesClient) ListGremlinGraphsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGremlinGraphsSender sends the ListGremlinGraphs request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) ListGremlinGraphsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGremlinGraphsResponder handles the response to the ListGremlinGraphs request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) ListGremlinGraphsResponder(resp *http.Response) (result GremlinGraphListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinDatabaseToAutoscale migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateGremlinDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinDatabaseToAutoscalePreparer prepares the MigrateGremlinDatabaseToAutoscale request. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinDatabaseToAutoscaleSender sends the MigrateGremlinDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscaleSender(req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinDatabaseToAutoscaleResponder handles the response to the MigrateGremlinDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinDatabaseToManualThroughput migrate an Azure Cosmos DB Gremlin database from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateGremlinDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinDatabaseToManualThroughputPreparer prepares the MigrateGremlinDatabaseToManualThroughput request. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinDatabaseToManualThroughputSender sends the MigrateGremlinDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputSender(req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinDatabaseToManualThroughputResponder handles the response to the MigrateGremlinDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinGraphToAutoscale migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinGraphToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", err.Error()) + } + + req, err := client.MigrateGremlinGraphToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinGraphToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinGraphToAutoscalePreparer prepares the MigrateGremlinGraphToAutoscale request. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinGraphToAutoscaleSender sends the MigrateGremlinGraphToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscaleSender(req *http.Request) (future GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinGraphToAutoscaleResponder handles the response to the MigrateGremlinGraphToAutoscale request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinGraphToManualThroughput migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinGraphToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", err.Error()) + } + + req, err := client.MigrateGremlinGraphToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinGraphToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinGraphToManualThroughputPreparer prepares the MigrateGremlinGraphToManualThroughput request. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinGraphToManualThroughputSender sends the MigrateGremlinGraphToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputSender(req *http.Request) (future GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinGraphToManualThroughputResponder handles the response to the MigrateGremlinGraphToManualThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateGremlinDatabaseThroughput update RUs per second of an Azure Cosmos DB Gremlin database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin +// database. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateGremlinDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateGremlinDatabaseThroughputPreparer prepares the UpdateGremlinDatabaseThroughput request. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateGremlinDatabaseThroughputSender sends the UpdateGremlinDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateGremlinDatabaseThroughputResponder handles the response to the UpdateGremlinDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateGremlinGraphThroughput update RUs per second of an Azure Cosmos DB Gremlin graph +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin graph. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinGraphThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", err.Error()) + } + + req, err := client.UpdateGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateGremlinGraphThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateGremlinGraphThroughputPreparer prepares the UpdateGremlinGraphThroughput request. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateGremlinGraphThroughputSender sends the UpdateGremlinGraphThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateGremlinGraphThroughputResponder handles the response to the UpdateGremlinGraphThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/models.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/models.go new file mode 100644 index 000000000000..c04c806b1ebf --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/models.go @@ -0,0 +1,9490 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-04-15/documentdb" + +// APIProperties ... +type APIProperties struct { + // ServerVersion - Describes the ServerVersion of an a MongoDB account. Possible values include: 'ThreeFullStopTwo', 'ThreeFullStopSix', 'FourFullStopZero' + ServerVersion ServerVersion `json:"serverVersion,omitempty"` +} + +// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other +// than required location and tags +type ARMProxyResource struct { + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ARMProxyResource. +func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ARMResourceProperties the core properties of ARM resources. +type ARMResourceProperties struct { + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ARMResourceProperties. +func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arp.Location != nil { + objectMap["location"] = arp.Location + } + if arp.Tags != nil { + objectMap["tags"] = arp.Tags + } + return json.Marshal(objectMap) +} + +// AutoscaleSettings ... +type AutoscaleSettings struct { + // MaxThroughput - Represents maximum throughput, the resource can scale up to. + MaxThroughput *int32 `json:"maxThroughput,omitempty"` +} + +// AutoscaleSettingsResource cosmos DB provisioned throughput settings object +type AutoscaleSettingsResource struct { + // MaxThroughput - Represents maximum throughput container can scale up to. + MaxThroughput *int32 `json:"maxThroughput,omitempty"` + // AutoUpgradePolicy - Cosmos DB resource auto-upgrade policy + AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"` + // TargetMaxThroughput - READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state. + TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoscaleSettingsResource. +func (asr AutoscaleSettingsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.MaxThroughput != nil { + objectMap["maxThroughput"] = asr.MaxThroughput + } + if asr.AutoUpgradePolicy != nil { + objectMap["autoUpgradePolicy"] = asr.AutoUpgradePolicy + } + return json.Marshal(objectMap) +} + +// AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy +type AutoUpgradePolicyResource struct { + // ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade + ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicBackupPolicy the object representing the policy for taking backups on an account. +type BasicBackupPolicy interface { + AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) + AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) + AsBackupPolicy() (*BackupPolicy, bool) +} + +// BackupPolicy the object representing the policy for taking backups on an account. +type BackupPolicy struct { + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +func unmarshalBasicBackupPolicy(body []byte) (BasicBackupPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypePeriodic): + var pmbp PeriodicModeBackupPolicy + err := json.Unmarshal(body, &pmbp) + return pmbp, err + case string(TypeContinuous): + var cmbp ContinuousModeBackupPolicy + err := json.Unmarshal(body, &cmbp) + return cmbp, err + default: + var bp BackupPolicy + err := json.Unmarshal(body, &bp) + return bp, err + } +} +func unmarshalBasicBackupPolicyArray(body []byte) ([]BasicBackupPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + bpArray := make([]BasicBackupPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + bp, err := unmarshalBasicBackupPolicy(*rawMessage) + if err != nil { + return nil, err + } + bpArray[index] = bp + } + return bpArray, nil +} + +// MarshalJSON is the custom marshaler for BackupPolicy. +func (bp BackupPolicy) MarshalJSON() ([]byte, error) { + bp.Type = TypeBackupPolicy + objectMap := make(map[string]interface{}) + if bp.Type != "" { + objectMap["type"] = bp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return nil, false +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return nil, false +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return &bp, true +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &bp, true +} + +// Capability cosmos DB capability object +type Capability struct { + // Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". + Name *string `json:"name,omitempty"` +} + +// CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace. +type CassandraKeyspaceCreateUpdateParameters struct { + // CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace. + *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters. +func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckcup.CassandraKeyspaceCreateUpdateProperties != nil { + objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties + } + if ckcup.Location != nil { + objectMap["location"] = ckcup.Location + } + if ckcup.Tags != nil { + objectMap["tags"] = ckcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct. +func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties + err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties) + if err != nil { + return err + } + ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ckcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ckcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ckcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ckcup.Tags = tags + } + } + } + + return nil +} + +// CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra +// keyspace. +type CassandraKeyspaceCreateUpdateProperties struct { + // Resource - The standard JSON format of a Cassandra keyspace + Resource *CassandraKeyspaceResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace +type CassandraKeyspaceGetProperties struct { + Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"` + Options *CassandraKeyspaceGetPropertiesOptions `json:"options,omitempty"` +} + +// CassandraKeyspaceGetPropertiesOptions ... +type CassandraKeyspaceGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// CassandraKeyspaceGetPropertiesResource ... +type CassandraKeyspaceGetPropertiesResource struct { + // ID - Name of the Cosmos DB Cassandra keyspace + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource. +func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckgp.ID != nil { + objectMap["id"] = ckgp.ID + } + return json.Marshal(objectMap) +} + +// CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace. +type CassandraKeyspaceGetResults struct { + autorest.Response `json:"-"` + // CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace + *CassandraKeyspaceGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults. +func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckgr.CassandraKeyspaceGetProperties != nil { + objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties + } + if ckgr.Location != nil { + objectMap["location"] = ckgr.Location + } + if ckgr.Tags != nil { + objectMap["tags"] = ckgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct. +func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties + err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties) + if err != nil { + return err + } + ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ckgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ckgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ckgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ckgr.Tags = tags + } + } + } + + return nil +} + +// CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their +// properties. +type CassandraKeyspaceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cassandra keyspaces and their properties. + Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceListResult. +func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object +type CassandraKeyspaceResource struct { + // ID - Name of the Cosmos DB Cassandra keyspace + ID *string `json:"id,omitempty"` +} + +// CassandraPartitionKey cosmos DB Cassandra table partition key +type CassandraPartitionKey struct { + // Name - Name of the Cosmos DB Cassandra table partition key + Name *string `json:"name,omitempty"` +} + +// CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesCreateUpdateCassandraKeyspaceFuture.Result. +func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ckgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent { + ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesCreateUpdateCassandraTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (CassandraTableGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesCreateUpdateCassandraTableFuture.Result. +func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ctgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent { + ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type CassandraResourcesDeleteCassandraKeyspaceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesDeleteCassandraKeyspaceFuture.Result. +func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type CassandraResourcesDeleteCassandraTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesDeleteCassandraTableFuture.Result. +func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture.Result. +func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture.Result. +func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraTableToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraTableToAutoscaleFuture.Result. +func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraTableToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraTableToManualThroughputFuture.Result. +func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesUpdateCassandraKeyspaceThroughputFuture.Result. +func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesUpdateCassandraTableThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesUpdateCassandraTableThroughputFuture.Result. +func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraSchema cosmos DB Cassandra table schema +type CassandraSchema struct { + // Columns - List of Cassandra table columns. + Columns *[]Column `json:"columns,omitempty"` + // PartitionKeys - List of partition key. + PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"` + // ClusterKeys - List of cluster key. + ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"` +} + +// CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table. +type CassandraTableCreateUpdateParameters struct { + // CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table. + *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters. +func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcup.CassandraTableCreateUpdateProperties != nil { + objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties + } + if ctcup.Location != nil { + objectMap["location"] = ctcup.Location + } + if ctcup.Tags != nil { + objectMap["tags"] = ctcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct. +func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties + err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties) + if err != nil { + return err + } + ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ctcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ctcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ctcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ctcup.Tags = tags + } + } + } + + return nil +} + +// CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table. +type CassandraTableCreateUpdateProperties struct { + // Resource - The standard JSON format of a Cassandra table + Resource *CassandraTableResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table +type CassandraTableGetProperties struct { + Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"` + Options *CassandraTableGetPropertiesOptions `json:"options,omitempty"` +} + +// CassandraTableGetPropertiesOptions ... +type CassandraTableGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// CassandraTableGetPropertiesResource ... +type CassandraTableGetPropertiesResource struct { + // ID - Name of the Cosmos DB Cassandra table + ID *string `json:"id,omitempty"` + // DefaultTTL - Time to live of the Cosmos DB Cassandra table + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // Schema - Schema of the Cosmos DB Cassandra table + Schema *CassandraSchema `json:"schema,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource. +func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctgp.ID != nil { + objectMap["id"] = ctgp.ID + } + if ctgp.DefaultTTL != nil { + objectMap["defaultTtl"] = ctgp.DefaultTTL + } + if ctgp.Schema != nil { + objectMap["schema"] = ctgp.Schema + } + if ctgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = ctgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// CassandraTableGetResults an Azure Cosmos DB Cassandra table. +type CassandraTableGetResults struct { + autorest.Response `json:"-"` + // CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table + *CassandraTableGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CassandraTableGetResults. +func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctgr.CassandraTableGetProperties != nil { + objectMap["properties"] = ctgr.CassandraTableGetProperties + } + if ctgr.Location != nil { + objectMap["location"] = ctgr.Location + } + if ctgr.Tags != nil { + objectMap["tags"] = ctgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct. +func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraTableGetProperties CassandraTableGetProperties + err = json.Unmarshal(*v, &cassandraTableGetProperties) + if err != nil { + return err + } + ctgr.CassandraTableGetProperties = &cassandraTableGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ctgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ctgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ctgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ctgr.Tags = tags + } + } + } + + return nil +} + +// CassandraTableListResult the List operation response, that contains the Cassandra tables and their +// properties. +type CassandraTableListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cassandra tables and their properties. + Value *[]CassandraTableGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableListResult. +func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CassandraTableResource cosmos DB Cassandra table resource object +type CassandraTableResource struct { + // ID - Name of the Cosmos DB Cassandra table + ID *string `json:"id,omitempty"` + // DefaultTTL - Time to live of the Cosmos DB Cassandra table + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // Schema - Schema of the Cosmos DB Cassandra table + Schema *CassandraSchema `json:"schema,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + Error *ErrorResponse `json:"error,omitempty"` +} + +// ClusterKey cosmos DB Cassandra table cluster key +type ClusterKey struct { + // Name - Name of the Cosmos DB Cassandra table cluster key + Name *string `json:"name,omitempty"` + // OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" + OrderBy *string `json:"orderBy,omitempty"` +} + +// Column cosmos DB Cassandra table column +type Column struct { + // Name - Name of the Cosmos DB Cassandra table column + Name *string `json:"name,omitempty"` + // Type - Type of the Cosmos DB Cassandra table column + Type *string `json:"type,omitempty"` +} + +// CompositePath ... +type CompositePath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Order - Sort order for composite paths. Possible values include: 'Ascending', 'Descending' + Order CompositePathSortOrder `json:"order,omitempty"` +} + +// ConflictResolutionPolicy the conflict resolution policy for the container. +type ConflictResolutionPolicy struct { + // Mode - Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom' + Mode ConflictResolutionMode `json:"mode,omitempty"` + // ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode. + ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"` + // ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode. + ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"` +} + +// ConsistencyPolicy the consistency policy for the Cosmos DB database account. +type ConsistencyPolicy struct { + // DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' + DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"` + // MaxStalenessPrefix - When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"` + // MaxIntervalInSeconds - When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"` +} + +// ContainerPartitionKey the configuration of the partition key to be used for partitioning data into +// multiple partitions +type ContainerPartitionKey struct { + // Paths - List of paths using which data within the container can be partitioned + Paths *[]string `json:"paths,omitempty"` + // Kind - Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. Possible values include: 'PartitionKindHash', 'PartitionKindRange', 'PartitionKindMultiHash' + Kind PartitionKind `json:"kind,omitempty"` + // Version - Indicates the version of the partition key definition + Version *int32 `json:"version,omitempty"` + // SystemKey - READ-ONLY; Indicates if the container is using a system generated partition key + SystemKey *bool `json:"systemKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerPartitionKey. +func (cpk ContainerPartitionKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpk.Paths != nil { + objectMap["paths"] = cpk.Paths + } + if cpk.Kind != "" { + objectMap["kind"] = cpk.Kind + } + if cpk.Version != nil { + objectMap["version"] = cpk.Version + } + return json.Marshal(objectMap) +} + +// ContinuousModeBackupPolicy the object representing continuous mode backup policy. +type ContinuousModeBackupPolicy struct { + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { + cmbp.Type = TypeContinuous + objectMap := make(map[string]interface{}) + if cmbp.Type != "" { + objectMap["type"] = cmbp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return nil, false +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return &cmbp, true +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return nil, false +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &cmbp, true +} + +// CorsPolicy the CORS policy for the Cosmos DB database account. +type CorsPolicy struct { + // AllowedOrigins - The origin domains that are permitted to make a request against the service via CORS. + AllowedOrigins *string `json:"allowedOrigins,omitempty"` + // AllowedMethods - The methods (HTTP request verbs) that the origin domain may use for a CORS request. + AllowedMethods *string `json:"allowedMethods,omitempty"` + // AllowedHeaders - The request headers that the origin domain may specify on the CORS request. + AllowedHeaders *string `json:"allowedHeaders,omitempty"` + // ExposedHeaders - The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + ExposedHeaders *string `json:"exposedHeaders,omitempty"` + // MaxAgeInSeconds - The maximum amount time that a browser should cache the preflight OPTIONS request. + MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` +} + +// CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource. +// Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" +type CreateUpdateOptions struct { + // Throughput - Request Units per second. For example, "throughput": 10000. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// DatabaseAccountConnectionString connection string for the Cosmos DB account +type DatabaseAccountConnectionString struct { + // ConnectionString - READ-ONLY; Value of the connection string + ConnectionString *string `json:"connectionString,omitempty"` + // Description - READ-ONLY; Description of the connection string + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountConnectionString. +func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts. +type DatabaseAccountCreateUpdateParameters struct { + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters. +func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dacup.Kind != "" { + objectMap["kind"] = dacup.Kind + } + if dacup.Identity != nil { + objectMap["identity"] = dacup.Identity + } + if dacup.DatabaseAccountCreateUpdateProperties != nil { + objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties + } + if dacup.Location != nil { + objectMap["location"] = dacup.Location + } + if dacup.Tags != nil { + objectMap["tags"] = dacup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. +func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dacup.Kind = kind + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + dacup.Identity = &identity + } + case "properties": + if v != nil { + var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties + err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties) + if err != nil { + return err + } + dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dacup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dacup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dacup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dacup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dacup.Tags = tags + } + } + } + + return nil +} + +// DatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts. +type DatabaseAccountCreateUpdateProperties struct { + // ConsistencyPolicy - The consistency policy for the Cosmos DB account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // DatabaseAccountOfferType - The offer type for the database + DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. Currently, supported only for MongoDB API. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateProperties struct. +func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + dacup.ConsistencyPolicy = &consistencyPolicy + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + dacup.Locations = &locations + } + case "databaseAccountOfferType": + if v != nil { + var databaseAccountOfferType string + err = json.Unmarshal(*v, &databaseAccountOfferType) + if err != nil { + return err + } + dacup.DatabaseAccountOfferType = &databaseAccountOfferType + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + dacup.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + dacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + dacup.EnableAutomaticFailover = &enableAutomaticFailover + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + dacup.Capabilities = &capabilities + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + dacup.VirtualNetworkRules = &virtualNetworkRules + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + dacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + dacup.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + dacup.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + dacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + dacup.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + dacup.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + dacup.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + dacup.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + dacup.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + dacup.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + dacup.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dacup.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + dacup.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + dacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + } + } + + return nil +} + +// DatabaseAccountGetProperties properties for the database account. +type DatabaseAccountGetProperties struct { + ProvisioningState *string `json:"provisioningState,omitempty"` + // DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account. + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + // DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard' + DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account. + WriteLocations *[]Location `json:"writeLocations,omitempty"` + // ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account. + ReadLocations *[]Location `json:"readLocations,omitempty"` + // Locations - READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities. + FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountGetProperties. +func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dagp.ProvisioningState != nil { + objectMap["provisioningState"] = dagp.ProvisioningState + } + if dagp.IPRules != nil { + objectMap["ipRules"] = dagp.IPRules + } + if dagp.IsVirtualNetworkFilterEnabled != nil { + objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled + } + if dagp.EnableAutomaticFailover != nil { + objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover + } + if dagp.ConsistencyPolicy != nil { + objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy + } + if dagp.Capabilities != nil { + objectMap["capabilities"] = dagp.Capabilities + } + if dagp.VirtualNetworkRules != nil { + objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules + } + if dagp.EnableMultipleWriteLocations != nil { + objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations + } + if dagp.EnableCassandraConnector != nil { + objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector + } + if dagp.ConnectorOffer != "" { + objectMap["connectorOffer"] = dagp.ConnectorOffer + } + if dagp.DisableKeyBasedMetadataWriteAccess != nil { + objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess + } + if dagp.KeyVaultKeyURI != nil { + objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI + } + if dagp.DefaultIdentity != nil { + objectMap["defaultIdentity"] = dagp.DefaultIdentity + } + if dagp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess + } + if dagp.EnableFreeTier != nil { + objectMap["enableFreeTier"] = dagp.EnableFreeTier + } + if dagp.APIProperties != nil { + objectMap["apiProperties"] = dagp.APIProperties + } + if dagp.EnableAnalyticalStorage != nil { + objectMap["enableAnalyticalStorage"] = dagp.EnableAnalyticalStorage + } + objectMap["backupPolicy"] = dagp.BackupPolicy + if dagp.Cors != nil { + objectMap["cors"] = dagp.Cors + } + if dagp.NetworkACLBypass != "" { + objectMap["networkAclBypass"] = dagp.NetworkACLBypass + } + if dagp.NetworkACLBypassResourceIds != nil { + objectMap["networkAclBypassResourceIds"] = dagp.NetworkACLBypassResourceIds + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetProperties struct. +func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState string + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + dagp.ProvisioningState = &provisioningState + } + case "documentEndpoint": + if v != nil { + var documentEndpoint string + err = json.Unmarshal(*v, &documentEndpoint) + if err != nil { + return err + } + dagp.DocumentEndpoint = &documentEndpoint + } + case "databaseAccountOfferType": + if v != nil { + var databaseAccountOfferType DatabaseAccountOfferType + err = json.Unmarshal(*v, &databaseAccountOfferType) + if err != nil { + return err + } + dagp.DatabaseAccountOfferType = databaseAccountOfferType + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + dagp.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + dagp.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + dagp.EnableAutomaticFailover = &enableAutomaticFailover + } + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + dagp.ConsistencyPolicy = &consistencyPolicy + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + dagp.Capabilities = &capabilities + } + case "writeLocations": + if v != nil { + var writeLocations []Location + err = json.Unmarshal(*v, &writeLocations) + if err != nil { + return err + } + dagp.WriteLocations = &writeLocations + } + case "readLocations": + if v != nil { + var readLocations []Location + err = json.Unmarshal(*v, &readLocations) + if err != nil { + return err + } + dagp.ReadLocations = &readLocations + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + dagp.Locations = &locations + } + case "failoverPolicies": + if v != nil { + var failoverPolicies []FailoverPolicy + err = json.Unmarshal(*v, &failoverPolicies) + if err != nil { + return err + } + dagp.FailoverPolicies = &failoverPolicies + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + dagp.VirtualNetworkRules = &virtualNetworkRules + } + case "privateEndpointConnections": + if v != nil { + var privateEndpointConnections []PrivateEndpointConnection + err = json.Unmarshal(*v, &privateEndpointConnections) + if err != nil { + return err + } + dagp.PrivateEndpointConnections = &privateEndpointConnections + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + dagp.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + dagp.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + dagp.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + dagp.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + dagp.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + dagp.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + dagp.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + dagp.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + dagp.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + dagp.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + dagp.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dagp.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + dagp.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + dagp.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + } + } + + return nil +} + +// DatabaseAccountGetResults an Azure Cosmos DB database account. +type DatabaseAccountGetResults struct { + autorest.Response `json:"-"` + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + *DatabaseAccountGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountGetResults. +func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dagr.Kind != "" { + objectMap["kind"] = dagr.Kind + } + if dagr.Identity != nil { + objectMap["identity"] = dagr.Identity + } + if dagr.DatabaseAccountGetProperties != nil { + objectMap["properties"] = dagr.DatabaseAccountGetProperties + } + if dagr.Location != nil { + objectMap["location"] = dagr.Location + } + if dagr.Tags != nil { + objectMap["tags"] = dagr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetResults struct. +func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dagr.Kind = kind + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + dagr.Identity = &identity + } + case "properties": + if v != nil { + var databaseAccountGetProperties DatabaseAccountGetProperties + err = json.Unmarshal(*v, &databaseAccountGetProperties) + if err != nil { + return err + } + dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dagr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dagr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dagr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dagr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dagr.Tags = tags + } + } + } + + return nil +} + +// DatabaseAccountListConnectionStringsResult the connection strings for the given database account. +type DatabaseAccountListConnectionStringsResult struct { + autorest.Response `json:"-"` + // ConnectionStrings - An array that contains the connection strings for the Cosmos DB account. + ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"` +} + +// DatabaseAccountListKeysResult the access keys for the given database account. +type DatabaseAccountListKeysResult struct { + autorest.Response `json:"-"` + // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. + PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` + // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. + SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. +func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. +type DatabaseAccountListReadOnlyKeysResult struct { + autorest.Response `json:"-"` + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountListReadOnlyKeysResult. +func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account. +type DatabaseAccountRegenerateKeyParameters struct { + // KeyKind - The access key to regenerate. Possible values include: 'Primary', 'Secondary', 'PrimaryReadonly', 'SecondaryReadonly' + KeyKind KeyKind `json:"keyKind,omitempty"` +} + +// DatabaseAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsCreateOrUpdateFuture.Result. +func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dagr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { + dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabaseAccountsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsDeleteFuture.Result. +func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsFailoverPriorityChangeFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type DatabaseAccountsFailoverPriorityChangeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsFailoverPriorityChangeFuture.Result. +func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsListResult the List operation response, that contains the database accounts and their +// properties. +type DatabaseAccountsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of database account and their properties. + Value *[]DatabaseAccountGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountsListResult. +func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountsOfflineRegionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsOfflineRegionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsOfflineRegionFuture.Result. +func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsOnlineRegionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsOnlineRegionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsOnlineRegionFuture.Result. +func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsRegenerateKeyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsRegenerateKeyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsRegenerateKeyFuture.Result. +func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabaseAccountsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsUpdateFuture.Result. +func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dagr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { + dagr, err = client.UpdateResponder(dagr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseAccountUpdateParameters parameters for patching Azure Cosmos DB database account properties. +type DatabaseAccountUpdateParameters struct { + Tags map[string]*string `json:"tags"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + *DatabaseAccountUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters. +func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if daup.Tags != nil { + objectMap["tags"] = daup.Tags + } + if daup.Location != nil { + objectMap["location"] = daup.Location + } + if daup.Identity != nil { + objectMap["identity"] = daup.Identity + } + if daup.DatabaseAccountUpdateProperties != nil { + objectMap["properties"] = daup.DatabaseAccountUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateParameters struct. +func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + daup.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + daup.Location = &location + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + daup.Identity = &identity + } + case "properties": + if v != nil { + var databaseAccountUpdateProperties DatabaseAccountUpdateProperties + err = json.Unmarshal(*v, &databaseAccountUpdateProperties) + if err != nil { + return err + } + daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties + } + } + } + + return nil +} + +// DatabaseAccountUpdateProperties properties to update Azure Cosmos DB database accounts. +type DatabaseAccountUpdateProperties struct { + // ConsistencyPolicy - The consistency policy for the Cosmos DB account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. Currently, supported only for MongoDB API. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateProperties struct. +func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + daup.ConsistencyPolicy = &consistencyPolicy + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + daup.Locations = &locations + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + daup.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + daup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + daup.EnableAutomaticFailover = &enableAutomaticFailover + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + daup.Capabilities = &capabilities + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + daup.VirtualNetworkRules = &virtualNetworkRules + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + daup.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + daup.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + daup.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + daup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + daup.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + daup.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + daup.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + daup.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + daup.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + daup.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + daup.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + daup.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + daup.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + daup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + } + } + + return nil +} + +// ErrorResponse error Response. +type ErrorResponse struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// ExcludedPath ... +type ExcludedPath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` +} + +// ExtendedResourceProperties the system generated resource properties associated with SQL databases, SQL +// containers, Gremlin databases and Gremlin graphs. +type ExtendedResourceProperties struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedResourceProperties. +func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FailoverPolicies the list of new failover policies for the failover priority change. +type FailoverPolicies struct { + // FailoverPolicies - List of failover policies. + FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` +} + +// FailoverPolicy the failover policy for a given region of a database account. +type FailoverPolicy struct { + // ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. + ID *string `json:"id,omitempty"` + // LocationName - The name of the region in which the database account exists. + LocationName *string `json:"locationName,omitempty"` + // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + FailoverPriority *int32 `json:"failoverPriority,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverPolicy. +func (fp FailoverPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fp.LocationName != nil { + objectMap["locationName"] = fp.LocationName + } + if fp.FailoverPriority != nil { + objectMap["failoverPriority"] = fp.FailoverPriority + } + return json.Marshal(objectMap) +} + +// GremlinDatabaseCreateUpdateParameters parameters to create and update Cosmos DB Gremlin database. +type GremlinDatabaseCreateUpdateParameters struct { + // GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database. + *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseCreateUpdateParameters. +func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdcup.GremlinDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties + } + if gdcup.Location != nil { + objectMap["location"] = gdcup.Location + } + if gdcup.Tags != nil { + objectMap["tags"] = gdcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseCreateUpdateParameters struct. +func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties) + if err != nil { + return err + } + gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gdcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gdcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gdcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gdcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gdcup.Tags = tags + } + } + } + + return nil +} + +// GremlinDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin database. +type GremlinDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a Gremlin database + Resource *GremlinDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GremlinDatabaseGetProperties the properties of an Azure Cosmos DB SQL database +type GremlinDatabaseGetProperties struct { + Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// GremlinDatabaseGetPropertiesOptions ... +type GremlinDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// GremlinDatabaseGetPropertiesResource ... +type GremlinDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB Gremlin database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseGetPropertiesResource. +func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdgp.ID != nil { + objectMap["id"] = gdgp.ID + } + return json.Marshal(objectMap) +} + +// GremlinDatabaseGetResults an Azure Cosmos DB Gremlin database. +type GremlinDatabaseGetResults struct { + autorest.Response `json:"-"` + // GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database + *GremlinDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseGetResults. +func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdgr.GremlinDatabaseGetProperties != nil { + objectMap["properties"] = gdgr.GremlinDatabaseGetProperties + } + if gdgr.Location != nil { + objectMap["location"] = gdgr.Location + } + if gdgr.Tags != nil { + objectMap["tags"] = gdgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseGetResults struct. +func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinDatabaseGetProperties GremlinDatabaseGetProperties + err = json.Unmarshal(*v, &gremlinDatabaseGetProperties) + if err != nil { + return err + } + gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gdgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gdgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gdgr.Tags = tags + } + } + } + + return nil +} + +// GremlinDatabaseListResult the List operation response, that contains the Gremlin databases and their +// properties. +type GremlinDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Gremlin databases and their properties. + Value *[]GremlinDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseListResult. +func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GremlinDatabaseResource cosmos DB Gremlin database resource object +type GremlinDatabaseResource struct { + // ID - Name of the Cosmos DB Gremlin database + ID *string `json:"id,omitempty"` +} + +// GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateParameters struct { + // GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph. + *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters. +func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggcup.GremlinGraphCreateUpdateProperties != nil { + objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties + } + if ggcup.Location != nil { + objectMap["location"] = ggcup.Location + } + if ggcup.Tags != nil { + objectMap["tags"] = ggcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct. +func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties + err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties) + if err != nil { + return err + } + ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ggcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ggcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ggcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ggcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ggcup.Tags = tags + } + } + } + + return nil +} + +// GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateProperties struct { + // Resource - The standard JSON format of a Gremlin graph + Resource *GremlinGraphResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GremlinGraphGetProperties the properties of an Azure Cosmos DB Gremlin graph +type GremlinGraphGetProperties struct { + Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"` + Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"` +} + +// GremlinGraphGetPropertiesOptions ... +type GremlinGraphGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// GremlinGraphGetPropertiesResource ... +type GremlinGraphGetPropertiesResource struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphGetPropertiesResource. +func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gggp.ID != nil { + objectMap["id"] = gggp.ID + } + if gggp.IndexingPolicy != nil { + objectMap["indexingPolicy"] = gggp.IndexingPolicy + } + if gggp.PartitionKey != nil { + objectMap["partitionKey"] = gggp.PartitionKey + } + if gggp.DefaultTTL != nil { + objectMap["defaultTtl"] = gggp.DefaultTTL + } + if gggp.UniqueKeyPolicy != nil { + objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy + } + if gggp.ConflictResolutionPolicy != nil { + objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy + } + return json.Marshal(objectMap) +} + +// GremlinGraphGetResults an Azure Cosmos DB Gremlin graph. +type GremlinGraphGetResults struct { + autorest.Response `json:"-"` + // GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph + *GremlinGraphGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphGetResults. +func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gggr.GremlinGraphGetProperties != nil { + objectMap["properties"] = gggr.GremlinGraphGetProperties + } + if gggr.Location != nil { + objectMap["location"] = gggr.Location + } + if gggr.Tags != nil { + objectMap["tags"] = gggr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraphGetResults struct. +func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphGetProperties GremlinGraphGetProperties + err = json.Unmarshal(*v, &gremlinGraphGetProperties) + if err != nil { + return err + } + gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gggr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gggr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gggr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gggr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gggr.Tags = tags + } + } + } + + return nil +} + +// GremlinGraphListResult the List operation response, that contains the graphs and their properties. +type GremlinGraphListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of graphs and their properties. + Value *[]GremlinGraphGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphListResult. +func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GremlinGraphResource cosmos DB Gremlin graph resource object +type GremlinGraphResource struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` +} + +// GremlinResourcesCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesCreateUpdateGremlinDatabaseFuture.Result. +func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent { + gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type GremlinResourcesCreateUpdateGremlinGraphFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (GremlinGraphGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesCreateUpdateGremlinGraphFuture.Result. +func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gggr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent { + gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type GremlinResourcesDeleteGremlinDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesDeleteGremlinDatabaseFuture.Result. +func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// GremlinResourcesDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GremlinResourcesDeleteGremlinGraphFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesDeleteGremlinGraphFuture.Result. +func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture") + return + } + ar.Response = future.Response() + return +} + +// GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture.Result. +func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture.Result. +func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinGraphToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinGraphToAutoscaleFuture.Result. +func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinGraphToManualThroughputFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinGraphToManualThroughputFuture.Result. +func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesUpdateGremlinDatabaseThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesUpdateGremlinDatabaseThroughputFuture.Result. +func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesUpdateGremlinGraphThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesUpdateGremlinGraphThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesUpdateGremlinGraphThroughputFuture.Result. +func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// IncludedPath the paths that are included in indexing +type IncludedPath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Indexes - List of indexes for this path + Indexes *[]Indexes `json:"indexes,omitempty"` +} + +// Indexes the indexes for the path. +type Indexes struct { + // DataType - The datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon' + DataType DataType `json:"dataType,omitempty"` + // Precision - The precision of the index. -1 is maximum precision. + Precision *int32 `json:"precision,omitempty"` + // Kind - Indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial' + Kind IndexKind `json:"kind,omitempty"` +} + +// IndexingPolicy cosmos DB indexing policy +type IndexingPolicy struct { + // Automatic - Indicates if the indexing policy is automatic + Automatic *bool `json:"automatic,omitempty"` + // IndexingMode - Indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None' + IndexingMode IndexingMode `json:"indexingMode,omitempty"` + // IncludedPaths - List of paths to include in the indexing + IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"` + // ExcludedPaths - List of paths to exclude from indexing + ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"` + // CompositeIndexes - List of composite path list + CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"` + // SpatialIndexes - List of spatial specifics + SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"` +} + +// IPAddressOrRange ipAddressOrRange object +type IPAddressOrRange struct { + // IPAddressOrRange - A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. + IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"` +} + +// Location a region in which the Azure Cosmos DB database account is deployed. +type Location struct { + // ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>. + ID *string `json:"id,omitempty"` + // LocationName - The name of the region. + LocationName *string `json:"locationName,omitempty"` + // DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + FailoverPriority *int32 `json:"failoverPriority,omitempty"` + // IsZoneRedundant - Flag to indicate whether or not this region is an AvailabilityZone region + IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"` +} + +// MarshalJSON is the custom marshaler for Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if l.LocationName != nil { + objectMap["locationName"] = l.LocationName + } + if l.ProvisioningState != nil { + objectMap["provisioningState"] = l.ProvisioningState + } + if l.FailoverPriority != nil { + objectMap["failoverPriority"] = l.FailoverPriority + } + if l.IsZoneRedundant != nil { + objectMap["isZoneRedundant"] = l.IsZoneRedundant + } + return json.Marshal(objectMap) +} + +// ManagedServiceIdentity identity for the resource. +type ManagedServiceIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msi.Type != "" { + objectMap["type"] = msi.Type + } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. +func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Metric metric data +type Metric struct { + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for Metric. +func (mVar Metric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.Unit != "" { + objectMap["unit"] = mVar.Unit + } + return json.Marshal(objectMap) +} + +// MetricAvailability the availability of the metric. +type MetricAvailability struct { + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Retention - READ-ONLY; The retention for the metric values. + Retention *string `json:"retention,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricAvailability. +func (ma MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricDefinition the definition of a metric. +type MetricDefinition struct { + // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. + MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` + // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' + PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // ResourceURI - READ-ONLY; The resource uri of the database. + ResourceURI *string `json:"resourceUri,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricDefinition. +func (md MetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if md.Unit != "" { + objectMap["unit"] = md.Unit + } + return json.Marshal(objectMap) +} + +// MetricDefinitionsListResult the response to a list metric definitions request. +type MetricDefinitionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of metric definitions for the account. + Value *[]MetricDefinition `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricDefinitionsListResult. +func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricListResult the response to a list metrics request. +type MetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of metrics for the account. + Value *[]Metric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricListResult. +func (mlr MetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricName a metric name. +type MetricName struct { + // Value - READ-ONLY; The name of the metric. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The friendly name of the metric. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricName. +func (mn MetricName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricValue represents metrics values. +type MetricValue struct { + // Count - READ-ONLY; The number of values for the metric. + Count *float64 `json:"_count,omitempty"` + // Average - READ-ONLY; The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - READ-ONLY; The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - READ-ONLY; The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - READ-ONLY; The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricValue. +func (mv MetricValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBCollectionCreateUpdateParameters parameters to create and update Cosmos DB MongoDB collection. +type MongoDBCollectionCreateUpdateParameters struct { + // MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection. + *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionCreateUpdateParameters. +func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdccup.MongoDBCollectionCreateUpdateProperties != nil { + objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties + } + if mdccup.Location != nil { + objectMap["location"] = mdccup.Location + } + if mdccup.Tags != nil { + objectMap["tags"] = mdccup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionCreateUpdateParameters struct. +func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties + err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties) + if err != nil { + return err + } + mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdccup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdccup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdccup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mdccup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mdccup.Tags = tags + } + } + } + + return nil +} + +// MongoDBCollectionCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB +// collection. +type MongoDBCollectionCreateUpdateProperties struct { + // Resource - The standard JSON format of a MongoDB collection + Resource *MongoDBCollectionResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// MongoDBCollectionGetProperties the properties of an Azure Cosmos DB MongoDB collection +type MongoDBCollectionGetProperties struct { + Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"` + Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"` +} + +// MongoDBCollectionGetPropertiesOptions ... +type MongoDBCollectionGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// MongoDBCollectionGetPropertiesResource ... +type MongoDBCollectionGetPropertiesResource struct { + // ID - Name of the Cosmos DB MongoDB collection + ID *string `json:"id,omitempty"` + // ShardKey - A key-value pair of shard keys to be applied for the request. + ShardKey map[string]*string `json:"shardKey"` + // Indexes - List of index keys + Indexes *[]MongoIndex `json:"indexes,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionGetPropertiesResource. +func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcgp.ID != nil { + objectMap["id"] = mdcgp.ID + } + if mdcgp.ShardKey != nil { + objectMap["shardKey"] = mdcgp.ShardKey + } + if mdcgp.Indexes != nil { + objectMap["indexes"] = mdcgp.Indexes + } + if mdcgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// MongoDBCollectionGetResults an Azure Cosmos DB MongoDB collection. +type MongoDBCollectionGetResults struct { + autorest.Response `json:"-"` + // MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection + *MongoDBCollectionGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionGetResults. +func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcgr.MongoDBCollectionGetProperties != nil { + objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties + } + if mdcgr.Location != nil { + objectMap["location"] = mdcgr.Location + } + if mdcgr.Tags != nil { + objectMap["tags"] = mdcgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionGetResults struct. +func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBCollectionGetProperties MongoDBCollectionGetProperties + err = json.Unmarshal(*v, &mongoDBCollectionGetProperties) + if err != nil { + return err + } + mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdcgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdcgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdcgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mdcgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mdcgr.Tags = tags + } + } + } + + return nil +} + +// MongoDBCollectionListResult the List operation response, that contains the MongoDB collections and their +// properties. +type MongoDBCollectionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB collections and their properties. + Value *[]MongoDBCollectionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionListResult. +func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBCollectionResource cosmos DB MongoDB collection resource object +type MongoDBCollectionResource struct { + // ID - Name of the Cosmos DB MongoDB collection + ID *string `json:"id,omitempty"` + // ShardKey - A key-value pair of shard keys to be applied for the request. + ShardKey map[string]*string `json:"shardKey"` + // Indexes - List of index keys + Indexes *[]MongoIndex `json:"indexes,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionResource. +func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcr.ID != nil { + objectMap["id"] = mdcr.ID + } + if mdcr.ShardKey != nil { + objectMap["shardKey"] = mdcr.ShardKey + } + if mdcr.Indexes != nil { + objectMap["indexes"] = mdcr.Indexes + } + if mdcr.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// MongoDBDatabaseCreateUpdateParameters parameters to create and update Cosmos DB MongoDB database. +type MongoDBDatabaseCreateUpdateParameters struct { + // MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database. + *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseCreateUpdateParameters. +func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddcup.MongoDBDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties + } + if mddcup.Location != nil { + objectMap["location"] = mddcup.Location + } + if mddcup.Tags != nil { + objectMap["tags"] = mddcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseCreateUpdateParameters struct. +func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties) + if err != nil { + return err + } + mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mddcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mddcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mddcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mddcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mddcup.Tags = tags + } + } + } + + return nil +} + +// MongoDBDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB database. +type MongoDBDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a MongoDB database + Resource *MongoDBDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// MongoDBDatabaseGetProperties the properties of an Azure Cosmos DB MongoDB database +type MongoDBDatabaseGetProperties struct { + Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// MongoDBDatabaseGetPropertiesOptions ... +type MongoDBDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// MongoDBDatabaseGetPropertiesResource ... +type MongoDBDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB MongoDB database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseGetPropertiesResource. +func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddgp.ID != nil { + objectMap["id"] = mddgp.ID + } + return json.Marshal(objectMap) +} + +// MongoDBDatabaseGetResults an Azure Cosmos DB MongoDB database. +type MongoDBDatabaseGetResults struct { + autorest.Response `json:"-"` + // MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database + *MongoDBDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseGetResults. +func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddgr.MongoDBDatabaseGetProperties != nil { + objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties + } + if mddgr.Location != nil { + objectMap["location"] = mddgr.Location + } + if mddgr.Tags != nil { + objectMap["tags"] = mddgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseGetResults struct. +func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties + err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties) + if err != nil { + return err + } + mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mddgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mddgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mddgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mddgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mddgr.Tags = tags + } + } + } + + return nil +} + +// MongoDBDatabaseListResult the List operation response, that contains the MongoDB databases and their +// properties. +type MongoDBDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB databases and their properties. + Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseListResult. +func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBDatabaseResource cosmos DB MongoDB database resource object +type MongoDBDatabaseResource struct { + // ID - Name of the Cosmos DB MongoDB database + ID *string `json:"id,omitempty"` +} + +// MongoDBResourcesCreateUpdateMongoDBCollectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBCollectionFuture.Result. +func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mdcgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent { + mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesCreateUpdateMongoDBDatabaseFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBDatabaseFuture.Result. +func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mddgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent { + mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesDeleteMongoDBCollectionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type MongoDBResourcesDeleteMongoDBCollectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesDeleteMongoDBCollectionFuture.Result. +func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture") + return + } + ar.Response = future.Response() + return +} + +// MongoDBResourcesDeleteMongoDBDatabaseFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type MongoDBResourcesDeleteMongoDBDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesDeleteMongoDBDatabaseFuture.Result. +func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesUpdateMongoDBCollectionThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesUpdateMongoDBCollectionThroughputFuture.Result. +func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture.Result. +func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoIndex cosmos DB MongoDB collection index key +type MongoIndex struct { + // Key - Cosmos DB MongoDB collection index keys + Key *MongoIndexKeys `json:"key,omitempty"` + // Options - Cosmos DB MongoDB collection index key options + Options *MongoIndexOptions `json:"options,omitempty"` +} + +// MongoIndexKeys cosmos DB MongoDB collection resource object +type MongoIndexKeys struct { + // Keys - List of keys for each MongoDB collection in the Azure Cosmos DB service + Keys *[]string `json:"keys,omitempty"` +} + +// MongoIndexOptions cosmos DB MongoDB collection index options +type MongoIndexOptions struct { + // ExpireAfterSeconds - Expire after seconds + ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"` + // Unique - Is unique or not + Unique *bool `json:"unique,omitempty"` +} + +// NotebookWorkspace a notebook workspace resource +type NotebookWorkspace struct { + autorest.Response `json:"-"` + // NotebookWorkspaceProperties - Resource properties. + *NotebookWorkspaceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspace. +func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nw.NotebookWorkspaceProperties != nil { + objectMap["properties"] = nw.NotebookWorkspaceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NotebookWorkspace struct. +func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var notebookWorkspaceProperties NotebookWorkspaceProperties + err = json.Unmarshal(*v, ¬ebookWorkspaceProperties) + if err != nil { + return err + } + nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nw.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nw.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nw.Type = &typeVar + } + } + } + + return nil +} + +// NotebookWorkspaceConnectionInfoResult the connection info for the given notebook workspace +type NotebookWorkspaceConnectionInfoResult struct { + autorest.Response `json:"-"` + // AuthToken - READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth). + AuthToken *string `json:"authToken,omitempty"` + // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. + NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceConnectionInfoResult. +func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspaceCreateUpdateParameters parameters to create a notebook workspace resource +type NotebookWorkspaceCreateUpdateParameters struct { + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceCreateUpdateParameters. +func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspaceListResult a list of notebook workspace resources +type NotebookWorkspaceListResult struct { + autorest.Response `json:"-"` + // Value - Array of notebook workspace resources + Value *[]NotebookWorkspace `json:"value,omitempty"` +} + +// NotebookWorkspaceProperties properties of a notebook workspace resource. +type NotebookWorkspaceProperties struct { + // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. + NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` + // Status - READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceProperties. +func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NotebookWorkspacesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (NotebookWorkspace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesCreateOrUpdateFuture.Result. +func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nw.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent { + nw, err = client.CreateOrUpdateResponder(nw.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request") + } + } + return +} + +// NotebookWorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NotebookWorkspacesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesDeleteFuture.Result. +func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// NotebookWorkspacesRegenerateAuthTokenFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type NotebookWorkspacesRegenerateAuthTokenFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesRegenerateAuthTokenFuture.Result. +func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture") + return + } + ar.Response = future.Response() + return +} + +// NotebookWorkspacesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NotebookWorkspacesStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesStartFuture.Result. +func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// Operation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft.ResourceProvider + Provider *string `json:"Provider,omitempty"` + // Resource - Resource on which the operation is performed: Profile, endpoint, etc. + Resource *string `json:"Resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"Operation,omitempty"` + // Description - Description of operation + Description *string `json:"Description,omitempty"` +} + +// OperationListResult result of the request to list Resource Provider operations. It contains a list of +// operations and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the Resource Provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// OptionsResource cosmos DB options resource object +type OptionsResource struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// PartitionMetric the metric values for a single partition. +type PartitionMetric struct { + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionMetric. +func (pm PartitionMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pm.Unit != "" { + objectMap["unit"] = pm.Unit + } + return json.Marshal(objectMap) +} + +// PartitionMetricListResult the response to a list partition metrics request. +type PartitionMetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of partition-level metrics for the account. + Value *[]PartitionMetric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionMetricListResult. +func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PartitionUsage the partition level usage data for a usage request. +type PartitionUsage struct { + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // Limit - READ-ONLY; Maximum value for this metric + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - READ-ONLY; Current value for this metric + CurrentValue *int64 `json:"currentValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionUsage. +func (pu PartitionUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pu.Unit != "" { + objectMap["unit"] = pu.Unit + } + return json.Marshal(objectMap) +} + +// PartitionUsagesResult the response to a list partition level usage request. +type PartitionUsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric + Value *[]PartitionUsage `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionUsagesResult. +func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PercentileMetric percentile Metric data +type PercentileMetric struct { + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep. + MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetric. +func (pm PercentileMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pm.Unit != "" { + objectMap["unit"] = pm.Unit + } + return json.Marshal(objectMap) +} + +// PercentileMetricListResult the response to a list percentile metrics request. +type PercentileMetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of percentile metrics for the account. + Value *[]PercentileMetric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetricListResult. +func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PercentileMetricValue represents percentile metrics values. +type PercentileMetricValue struct { + // P10 - READ-ONLY; The 10th percentile value for the metric. + P10 *float64 `json:"P10,omitempty"` + // P25 - READ-ONLY; The 25th percentile value for the metric. + P25 *float64 `json:"P25,omitempty"` + // P50 - READ-ONLY; The 50th percentile value for the metric. + P50 *float64 `json:"P50,omitempty"` + // P75 - READ-ONLY; The 75th percentile value for the metric. + P75 *float64 `json:"P75,omitempty"` + // P90 - READ-ONLY; The 90th percentile value for the metric. + P90 *float64 `json:"P90,omitempty"` + // P95 - READ-ONLY; The 95th percentile value for the metric. + P95 *float64 `json:"P95,omitempty"` + // P99 - READ-ONLY; The 99th percentile value for the metric. + P99 *float64 `json:"P99,omitempty"` + // Count - READ-ONLY; The number of values for the metric. + Count *float64 `json:"_count,omitempty"` + // Average - READ-ONLY; The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - READ-ONLY; The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - READ-ONLY; The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - READ-ONLY; The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetricValue. +func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PeriodicModeBackupPolicy the object representing periodic mode backup policy. +type PeriodicModeBackupPolicy struct { + // PeriodicModeProperties - Configuration values for periodic mode backup + PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"` + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { + pmbp.Type = TypePeriodic + objectMap := make(map[string]interface{}) + if pmbp.PeriodicModeProperties != nil { + objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties + } + if pmbp.Type != "" { + objectMap["type"] = pmbp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return &pmbp, true +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return nil, false +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return nil, false +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &pmbp, true +} + +// PeriodicModeProperties configuration values for periodic mode backup +type PeriodicModeProperties struct { + // BackupIntervalInMinutes - An integer representing the interval in minutes between two backups + BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"` + // BackupRetentionIntervalInHours - An integer representing the time (in hours) that each backup is retained + BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"` +} + +// Permission the set of data plane operations permitted through this Role Definition. +type Permission struct { + // DataActions - An array of data actions that are allowed. + DataActions *[]string `json:"dataActions,omitempty"` + // NotDataActions - An array of data actions that are denied. + NotDataActions *[]string `json:"notDataActions,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // GroupID - Group id of the private endpoint. + GroupID *string `json:"groupId,omitempty"` + // ProvisioningState - Provisioning state of the private endpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateOrUpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointProperty private endpoint which the connection belongs to. +type PrivateEndpointProperty struct { + // ID - Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; The private link resource required zone names. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. +type PrivateLinkServiceConnectionStateProperty struct { + // Status - The private link service connection status. + Status *string `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. +func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscsp.Status != nil { + objectMap["status"] = plscsp.Status + } + if plscsp.Description != nil { + objectMap["description"] = plscsp.Description + } + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RegionForOnlineOffline cosmos DB region to online or offline. +type RegionForOnlineOffline struct { + // Region - Cosmos DB region, with spaces between words and each word capitalized. + Region *string `json:"region,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SpatialSpec ... +type SpatialSpec struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Types - List of path's spatial type + Types *[]SpatialType `json:"types,omitempty"` +} + +// SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container. +type SQLContainerCreateUpdateParameters struct { + // SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. + *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters. +func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccup.SQLContainerCreateUpdateProperties != nil { + objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties + } + if sccup.Location != nil { + objectMap["location"] = sccup.Location + } + if sccup.Tags != nil { + objectMap["tags"] = sccup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct. +func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties + err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties) + if err != nil { + return err + } + sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sccup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sccup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sccup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sccup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sccup.Tags = tags + } + } + } + + return nil +} + +// SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. +type SQLContainerCreateUpdateProperties struct { + // Resource - The standard JSON format of a container + Resource *SQLContainerResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLContainerGetProperties the properties of an Azure Cosmos DB container +type SQLContainerGetProperties struct { + Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"` + Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"` +} + +// SQLContainerGetPropertiesOptions ... +type SQLContainerGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// SQLContainerGetPropertiesResource ... +type SQLContainerGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerGetPropertiesResource. +func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scgp.ID != nil { + objectMap["id"] = scgp.ID + } + if scgp.IndexingPolicy != nil { + objectMap["indexingPolicy"] = scgp.IndexingPolicy + } + if scgp.PartitionKey != nil { + objectMap["partitionKey"] = scgp.PartitionKey + } + if scgp.DefaultTTL != nil { + objectMap["defaultTtl"] = scgp.DefaultTTL + } + if scgp.UniqueKeyPolicy != nil { + objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy + } + if scgp.ConflictResolutionPolicy != nil { + objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy + } + if scgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// SQLContainerGetResults an Azure Cosmos DB container. +type SQLContainerGetResults struct { + autorest.Response `json:"-"` + // SQLContainerGetProperties - The properties of an Azure Cosmos DB container + *SQLContainerGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLContainerGetResults. +func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scgr.SQLContainerGetProperties != nil { + objectMap["properties"] = scgr.SQLContainerGetProperties + } + if scgr.Location != nil { + objectMap["location"] = scgr.Location + } + if scgr.Tags != nil { + objectMap["tags"] = scgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainerGetResults struct. +func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerGetProperties SQLContainerGetProperties + err = json.Unmarshal(*v, &SQLContainerGetProperties) + if err != nil { + return err + } + scgr.SQLContainerGetProperties = &SQLContainerGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + scgr.Tags = tags + } + } + } + + return nil +} + +// SQLContainerListResult the List operation response, that contains the containers and their properties. +type SQLContainerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of containers and their properties. + Value *[]SQLContainerGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerListResult. +func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLContainerResource cosmos DB SQL container resource object +type SQLContainerResource struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` +} + +// SQLDatabaseCreateUpdateParameters parameters to create and update Cosmos DB SQL database. +type SQLDatabaseCreateUpdateParameters struct { + // SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database. + *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseCreateUpdateParameters. +func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdcup.SQLDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties + } + if sdcup.Location != nil { + objectMap["location"] = sdcup.Location + } + if sdcup.Tags != nil { + objectMap["tags"] = sdcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLDatabaseCreateUpdateParameters struct. +func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties) + if err != nil { + return err + } + sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sdcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sdcup.Tags = tags + } + } + } + + return nil +} + +// SQLDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB SQL database. +type SQLDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a SQL database + Resource *SQLDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLDatabaseGetProperties the properties of an Azure Cosmos DB SQL database +type SQLDatabaseGetProperties struct { + Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// SQLDatabaseGetPropertiesOptions ... +type SQLDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// SQLDatabaseGetPropertiesResource ... +type SQLDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` + // Colls - A system generated property that specified the addressable path of the collections resource. + Colls *string `json:"_colls,omitempty"` + // Users - A system generated property that specifies the addressable path of the users resource. + Users *string `json:"_users,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseGetPropertiesResource. +func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdgp.ID != nil { + objectMap["id"] = sdgp.ID + } + if sdgp.Colls != nil { + objectMap["_colls"] = sdgp.Colls + } + if sdgp.Users != nil { + objectMap["_users"] = sdgp.Users + } + return json.Marshal(objectMap) +} + +// SQLDatabaseGetResults an Azure Cosmos DB SQL database. +type SQLDatabaseGetResults struct { + autorest.Response `json:"-"` + // SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database + *SQLDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseGetResults. +func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdgr.SQLDatabaseGetProperties != nil { + objectMap["properties"] = sdgr.SQLDatabaseGetProperties + } + if sdgr.Location != nil { + objectMap["location"] = sdgr.Location + } + if sdgr.Tags != nil { + objectMap["tags"] = sdgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLDatabaseGetResults struct. +func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLDatabaseGetProperties SQLDatabaseGetProperties + err = json.Unmarshal(*v, &SQLDatabaseGetProperties) + if err != nil { + return err + } + sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sdgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sdgr.Tags = tags + } + } + } + + return nil +} + +// SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties. +type SQLDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of SQL databases and their properties. + Value *[]SQLDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseListResult. +func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLDatabaseResource cosmos DB SQL database resource object +type SQLDatabaseResource struct { + // ID - Name of the Cosmos DB SQL database + ID *string `json:"id,omitempty"` +} + +// SQLResourcesCreateUpdateSQLContainerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLContainerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLContainerGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLContainerFuture.Result. +func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent { + scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLDatabaseFuture.Result. +func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent { + sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesCreateUpdateSQLRoleAssignmentFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLRoleAssignmentGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLRoleAssignmentFuture.Result. +func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) result(client SQLResourcesClient) (sragr SQLRoleAssignmentGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sragr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sragr.Response.Response, err = future.GetResult(sender); err == nil && sragr.Response.Response.StatusCode != http.StatusNoContent { + sragr, err = client.CreateUpdateSQLRoleAssignmentResponder(sragr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", sragr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesCreateUpdateSQLRoleDefinitionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLRoleDefinitionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLRoleDefinitionFuture.Result. +func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) result(client SQLResourcesClient) (srdgr SQLRoleDefinitionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + srdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if srdgr.Response.Response, err = future.GetResult(sender); err == nil && srdgr.Response.Response.StatusCode != http.StatusNoContent { + srdgr, err = client.CreateUpdateSQLRoleDefinitionResponder(srdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", srdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLStoredProcedureFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLStoredProcedureFuture.Result. +func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sspgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent { + sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLTriggerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLTriggerGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLTriggerFuture.Result. +func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + stgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent { + stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture.Result. +func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sudfgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent { + sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesDeleteSQLContainerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLContainerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLContainerFuture.Result. +func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLDatabaseFuture.Result. +func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLRoleAssignmentFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLRoleAssignmentFuture.Result. +func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLRoleDefinitionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLRoleDefinitionFuture.Result. +func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLStoredProcedureFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLStoredProcedureFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLStoredProcedureFuture.Result. +func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLTriggerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLTriggerFuture.Result. +func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLUserDefinedFunctionFuture.Result. +func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesMigrateSQLContainerToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLContainerToAutoscaleFuture.Result. +func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLContainerToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLContainerToManualThroughputFuture.Result. +func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLDatabaseToAutoscaleFuture.Result. +func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLDatabaseToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLDatabaseToManualThroughputFuture.Result. +func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesUpdateSQLContainerThroughputFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesUpdateSQLContainerThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesUpdateSQLContainerThroughputFuture.Result. +func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesUpdateSQLDatabaseThroughputFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesUpdateSQLDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesUpdateSQLDatabaseThroughputFuture.Result. +func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLRoleAssignmentCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role +// Assignment. +type SQLRoleAssignmentCreateUpdateParameters struct { + // SQLRoleAssignmentResource - Properties to create and update an Azure Cosmos DB SQL Role Assignment. + *SQLRoleAssignmentResource `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentCreateUpdateParameters. +func (sracup SQLRoleAssignmentCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sracup.SQLRoleAssignmentResource != nil { + objectMap["properties"] = sracup.SQLRoleAssignmentResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentCreateUpdateParameters struct. +func (sracup *SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleAssignmentResource SQLRoleAssignmentResource + err = json.Unmarshal(*v, &SQLRoleAssignmentResource) + if err != nil { + return err + } + sracup.SQLRoleAssignmentResource = &SQLRoleAssignmentResource + } + } + } + + return nil +} + +// SQLRoleAssignmentGetResults an Azure Cosmos DB Role Assignment +type SQLRoleAssignmentGetResults struct { + autorest.Response `json:"-"` + // SQLRoleAssignmentResource - Properties related to the Role Assignment. + *SQLRoleAssignmentResource `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentGetResults. +func (sragr SQLRoleAssignmentGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sragr.SQLRoleAssignmentResource != nil { + objectMap["properties"] = sragr.SQLRoleAssignmentResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentGetResults struct. +func (sragr *SQLRoleAssignmentGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleAssignmentResource SQLRoleAssignmentResource + err = json.Unmarshal(*v, &SQLRoleAssignmentResource) + if err != nil { + return err + } + sragr.SQLRoleAssignmentResource = &SQLRoleAssignmentResource + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sragr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sragr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sragr.Type = &typeVar + } + } + } + + return nil +} + +// SQLRoleAssignmentListResult the relevant Role Assignments. +type SQLRoleAssignmentListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Role Assignments and their properties + Value *[]SQLRoleAssignmentGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentListResult. +func (sralr SQLRoleAssignmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLRoleAssignmentResource azure Cosmos DB SQL Role Assignment resource object. +type SQLRoleAssignmentResource struct { + // RoleDefinitionID - The unique identifier for the associated Role Definition. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` + // Scope - The data plane resource path for which access is being granted through this Role Assignment. + Scope *string `json:"scope,omitempty"` + // PrincipalID - The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + PrincipalID *string `json:"principalId,omitempty"` +} + +// SQLRoleDefinitionCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role +// Definition. +type SQLRoleDefinitionCreateUpdateParameters struct { + // SQLRoleDefinitionResource - Properties to create and update an Azure Cosmos DB SQL Role Definition. + *SQLRoleDefinitionResource `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionCreateUpdateParameters. +func (srdcup SQLRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srdcup.SQLRoleDefinitionResource != nil { + objectMap["properties"] = srdcup.SQLRoleDefinitionResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionCreateUpdateParameters struct. +func (srdcup *SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleDefinitionResource SQLRoleDefinitionResource + err = json.Unmarshal(*v, &SQLRoleDefinitionResource) + if err != nil { + return err + } + srdcup.SQLRoleDefinitionResource = &SQLRoleDefinitionResource + } + } + } + + return nil +} + +// SQLRoleDefinitionGetResults an Azure Cosmos DB SQL Role Definition. +type SQLRoleDefinitionGetResults struct { + autorest.Response `json:"-"` + // SQLRoleDefinitionResource - Properties related to the Role Definition. + *SQLRoleDefinitionResource `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionGetResults. +func (srdgr SQLRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srdgr.SQLRoleDefinitionResource != nil { + objectMap["properties"] = srdgr.SQLRoleDefinitionResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionGetResults struct. +func (srdgr *SQLRoleDefinitionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleDefinitionResource SQLRoleDefinitionResource + err = json.Unmarshal(*v, &SQLRoleDefinitionResource) + if err != nil { + return err + } + srdgr.SQLRoleDefinitionResource = &SQLRoleDefinitionResource + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + srdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + srdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + srdgr.Type = &typeVar + } + } + } + + return nil +} + +// SQLRoleDefinitionListResult the relevant Role Definitions. +type SQLRoleDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Role Definitions and their properties. + Value *[]SQLRoleDefinitionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionListResult. +func (srdlr SQLRoleDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLRoleDefinitionResource azure Cosmos DB SQL Role Definition resource object. +type SQLRoleDefinitionResource struct { + // RoleName - A user-friendly name for the Role Definition. Must be unique for the database account. + RoleName *string `json:"roleName,omitempty"` + // Type - Indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole' + Type RoleDefinitionType `json:"type,omitempty"` + // AssignableScopes - A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + AssignableScopes *[]string `json:"assignableScopes,omitempty"` + // Permissions - The set of operations allowed through this Role Definition. + Permissions *[]Permission `json:"permissions,omitempty"` +} + +// SQLStoredProcedureCreateUpdateParameters parameters to create and update Cosmos DB storedProcedure. +type SQLStoredProcedureCreateUpdateParameters struct { + // SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure. + *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureCreateUpdateParameters. +func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspcup.SQLStoredProcedureCreateUpdateProperties != nil { + objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties + } + if sspcup.Location != nil { + objectMap["location"] = sspcup.Location + } + if sspcup.Tags != nil { + objectMap["tags"] = sspcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureCreateUpdateParameters struct. +func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties + err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties) + if err != nil { + return err + } + sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sspcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sspcup.Tags = tags + } + } + } + + return nil +} + +// SQLStoredProcedureCreateUpdateProperties properties to create and update Azure Cosmos DB +// storedProcedure. +type SQLStoredProcedureCreateUpdateProperties struct { + // Resource - The standard JSON format of a storedProcedure + Resource *SQLStoredProcedureResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLStoredProcedureGetProperties the properties of an Azure Cosmos DB StoredProcedure +type SQLStoredProcedureGetProperties struct { + Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLStoredProcedureGetPropertiesResource ... +type SQLStoredProcedureGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL storedProcedure + ID *string `json:"id,omitempty"` + // Body - Body of the Stored Procedure + Body *string `json:"body,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureGetPropertiesResource. +func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspgp.ID != nil { + objectMap["id"] = sspgp.ID + } + if sspgp.Body != nil { + objectMap["body"] = sspgp.Body + } + return json.Marshal(objectMap) +} + +// SQLStoredProcedureGetResults an Azure Cosmos DB storedProcedure. +type SQLStoredProcedureGetResults struct { + autorest.Response `json:"-"` + // SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB storedProcedure + *SQLStoredProcedureGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureGetResults. +func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspgr.SQLStoredProcedureGetProperties != nil { + objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties + } + if sspgr.Location != nil { + objectMap["location"] = sspgr.Location + } + if sspgr.Tags != nil { + objectMap["tags"] = sspgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureGetResults struct. +func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties + err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties) + if err != nil { + return err + } + sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sspgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sspgr.Tags = tags + } + } + } + + return nil +} + +// SQLStoredProcedureListResult the List operation response, that contains the storedProcedures and their +// properties. +type SQLStoredProcedureListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of storedProcedures and their properties. + Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureListResult. +func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLStoredProcedureResource cosmos DB SQL storedProcedure resource object +type SQLStoredProcedureResource struct { + // ID - Name of the Cosmos DB SQL storedProcedure + ID *string `json:"id,omitempty"` + // Body - Body of the Stored Procedure + Body *string `json:"body,omitempty"` +} + +// SQLTriggerCreateUpdateParameters parameters to create and update Cosmos DB trigger. +type SQLTriggerCreateUpdateParameters struct { + // SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger. + *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerCreateUpdateParameters. +func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stcup.SQLTriggerCreateUpdateProperties != nil { + objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties + } + if stcup.Location != nil { + objectMap["location"] = stcup.Location + } + if stcup.Tags != nil { + objectMap["tags"] = stcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLTriggerCreateUpdateParameters struct. +func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties + err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties) + if err != nil { + return err + } + stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + stcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + stcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + stcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + stcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + stcup.Tags = tags + } + } + } + + return nil +} + +// SQLTriggerCreateUpdateProperties properties to create and update Azure Cosmos DB trigger. +type SQLTriggerCreateUpdateProperties struct { + // Resource - The standard JSON format of a trigger + Resource *SQLTriggerResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLTriggerGetProperties the properties of an Azure Cosmos DB trigger +type SQLTriggerGetProperties struct { + Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLTriggerGetPropertiesResource ... +type SQLTriggerGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL trigger + ID *string `json:"id,omitempty"` + // Body - Body of the Trigger + Body *string `json:"body,omitempty"` + // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' + TriggerType TriggerType `json:"triggerType,omitempty"` + // TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace' + TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerGetPropertiesResource. +func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stgp.ID != nil { + objectMap["id"] = stgp.ID + } + if stgp.Body != nil { + objectMap["body"] = stgp.Body + } + if stgp.TriggerType != "" { + objectMap["triggerType"] = stgp.TriggerType + } + if stgp.TriggerOperation != "" { + objectMap["triggerOperation"] = stgp.TriggerOperation + } + return json.Marshal(objectMap) +} + +// SQLTriggerGetResults an Azure Cosmos DB trigger. +type SQLTriggerGetResults struct { + autorest.Response `json:"-"` + // SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger + *SQLTriggerGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerGetResults. +func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stgr.SQLTriggerGetProperties != nil { + objectMap["properties"] = stgr.SQLTriggerGetProperties + } + if stgr.Location != nil { + objectMap["location"] = stgr.Location + } + if stgr.Tags != nil { + objectMap["tags"] = stgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLTriggerGetResults struct. +func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLTriggerGetProperties SQLTriggerGetProperties + err = json.Unmarshal(*v, &SQLTriggerGetProperties) + if err != nil { + return err + } + stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + stgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + stgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + stgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + stgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + stgr.Tags = tags + } + } + } + + return nil +} + +// SQLTriggerListResult the List operation response, that contains the triggers and their properties. +type SQLTriggerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of triggers and their properties. + Value *[]SQLTriggerGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerListResult. +func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLTriggerResource cosmos DB SQL trigger resource object +type SQLTriggerResource struct { + // ID - Name of the Cosmos DB SQL trigger + ID *string `json:"id,omitempty"` + // Body - Body of the Trigger + Body *string `json:"body,omitempty"` + // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' + TriggerType TriggerType `json:"triggerType,omitempty"` + // TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace' + TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` +} + +// SQLUserDefinedFunctionCreateUpdateParameters parameters to create and update Cosmos DB +// userDefinedFunction. +type SQLUserDefinedFunctionCreateUpdateParameters struct { + // SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction. + *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionCreateUpdateParameters. +func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil { + objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties + } + if sudfcup.Location != nil { + objectMap["location"] = sudfcup.Location + } + if sudfcup.Tags != nil { + objectMap["tags"] = sudfcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionCreateUpdateParameters struct. +func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties + err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties) + if err != nil { + return err + } + sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sudfcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sudfcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sudfcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sudfcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sudfcup.Tags = tags + } + } + } + + return nil +} + +// SQLUserDefinedFunctionCreateUpdateProperties properties to create and update Azure Cosmos DB +// userDefinedFunction. +type SQLUserDefinedFunctionCreateUpdateProperties struct { + // Resource - The standard JSON format of a userDefinedFunction + Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLUserDefinedFunctionGetProperties the properties of an Azure Cosmos DB userDefinedFunction +type SQLUserDefinedFunctionGetProperties struct { + Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLUserDefinedFunctionGetPropertiesResource ... +type SQLUserDefinedFunctionGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL userDefinedFunction + ID *string `json:"id,omitempty"` + // Body - Body of the User Defined Function + Body *string `json:"body,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetPropertiesResource. +func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfgp.ID != nil { + objectMap["id"] = sudfgp.ID + } + if sudfgp.Body != nil { + objectMap["body"] = sudfgp.Body + } + return json.Marshal(objectMap) +} + +// SQLUserDefinedFunctionGetResults an Azure Cosmos DB userDefinedFunction. +type SQLUserDefinedFunctionGetResults struct { + autorest.Response `json:"-"` + // SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction + *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetResults. +func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfgr.SQLUserDefinedFunctionGetProperties != nil { + objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties + } + if sudfgr.Location != nil { + objectMap["location"] = sudfgr.Location + } + if sudfgr.Tags != nil { + objectMap["tags"] = sudfgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionGetResults struct. +func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties + err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties) + if err != nil { + return err + } + sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sudfgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sudfgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sudfgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sudfgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sudfgr.Tags = tags + } + } + } + + return nil +} + +// SQLUserDefinedFunctionListResult the List operation response, that contains the userDefinedFunctions and +// their properties. +type SQLUserDefinedFunctionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of userDefinedFunctions and their properties. + Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionListResult. +func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLUserDefinedFunctionResource cosmos DB SQL userDefinedFunction resource object +type SQLUserDefinedFunctionResource struct { + // ID - Name of the Cosmos DB SQL userDefinedFunction + ID *string `json:"id,omitempty"` + // Body - Body of the User Defined Function + Body *string `json:"body,omitempty"` +} + +// TableCreateUpdateParameters parameters to create and update Cosmos DB Table. +type TableCreateUpdateParameters struct { + // TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table. + *TableCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TableCreateUpdateParameters. +func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcup.TableCreateUpdateProperties != nil { + objectMap["properties"] = tcup.TableCreateUpdateProperties + } + if tcup.Location != nil { + objectMap["location"] = tcup.Location + } + if tcup.Tags != nil { + objectMap["tags"] = tcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TableCreateUpdateParameters struct. +func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tableCreateUpdateProperties TableCreateUpdateProperties + err = json.Unmarshal(*v, &tableCreateUpdateProperties) + if err != nil { + return err + } + tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tcup.Tags = tags + } + } + } + + return nil +} + +// TableCreateUpdateProperties properties to create and update Azure Cosmos DB Table. +type TableCreateUpdateProperties struct { + // Resource - The standard JSON format of a Table + Resource *TableResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// TableGetProperties the properties of an Azure Cosmos Table +type TableGetProperties struct { + Resource *TableGetPropertiesResource `json:"resource,omitempty"` + Options *TableGetPropertiesOptions `json:"options,omitempty"` +} + +// TableGetPropertiesOptions ... +type TableGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// TableGetPropertiesResource ... +type TableGetPropertiesResource struct { + // ID - Name of the Cosmos DB table + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableGetPropertiesResource. +func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tgp.ID != nil { + objectMap["id"] = tgp.ID + } + return json.Marshal(objectMap) +} + +// TableGetResults an Azure Cosmos DB Table. +type TableGetResults struct { + autorest.Response `json:"-"` + // TableGetProperties - The properties of an Azure Cosmos DB Table + *TableGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TableGetResults. +func (tgr TableGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tgr.TableGetProperties != nil { + objectMap["properties"] = tgr.TableGetProperties + } + if tgr.Location != nil { + objectMap["location"] = tgr.Location + } + if tgr.Tags != nil { + objectMap["tags"] = tgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TableGetResults struct. +func (tgr *TableGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tableGetProperties TableGetProperties + err = json.Unmarshal(*v, &tableGetProperties) + if err != nil { + return err + } + tgr.TableGetProperties = &tableGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tgr.Tags = tags + } + } + } + + return nil +} + +// TableListResult the List operation response, that contains the Table and their properties. +type TableListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Table and their properties. + Value *[]TableGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableListResult. +func (tlr TableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TableResource cosmos DB table resource object +type TableResource struct { + // ID - Name of the Cosmos DB table + ID *string `json:"id,omitempty"` +} + +// TableResourcesCreateUpdateTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesCreateUpdateTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (TableGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesCreateUpdateTableFuture.Result. +func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent { + tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesDeleteTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesDeleteTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesDeleteTableFuture.Result. +func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture") + return + } + ar.Response = future.Response() + return +} + +// TableResourcesMigrateTableToAutoscaleFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type TableResourcesMigrateTableToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesMigrateTableToAutoscaleFuture.Result. +func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesMigrateTableToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type TableResourcesMigrateTableToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesMigrateTableToManualThroughputFuture.Result. +func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesUpdateTableThroughputFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesUpdateTableThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesUpdateTableThroughputFuture.Result. +func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// ThroughputPolicyResource cosmos DB resource throughput policy +type ThroughputPolicyResource struct { + // IsEnabled - Determines whether the ThroughputPolicy is active or not + IsEnabled *bool `json:"isEnabled,omitempty"` + // IncrementPercent - Represents the percentage by which throughput can increase every time throughput policy kicks in. + IncrementPercent *int32 `json:"incrementPercent,omitempty"` +} + +// ThroughputSettingsGetProperties the properties of an Azure Cosmos DB resource throughput +type ThroughputSettingsGetProperties struct { + Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"` +} + +// ThroughputSettingsGetPropertiesResource ... +type ThroughputSettingsGetPropertiesResource struct { + // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. + AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` + // MinimumThroughput - READ-ONLY; The minimum throughput of the resource + MinimumThroughput *string `json:"minimumThroughput,omitempty"` + // OfferReplacePending - READ-ONLY; The throughput replace is pending + OfferReplacePending *string `json:"offerReplacePending,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsGetPropertiesResource. +func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsgp.Throughput != nil { + objectMap["throughput"] = tsgp.Throughput + } + if tsgp.AutoscaleSettings != nil { + objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings + } + return json.Marshal(objectMap) +} + +// ThroughputSettingsGetResults an Azure Cosmos DB resource throughput. +type ThroughputSettingsGetResults struct { + autorest.Response `json:"-"` + // ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput + *ThroughputSettingsGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsGetResults. +func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsgr.ThroughputSettingsGetProperties != nil { + objectMap["properties"] = tsgr.ThroughputSettingsGetProperties + } + if tsgr.Location != nil { + objectMap["location"] = tsgr.Location + } + if tsgr.Tags != nil { + objectMap["tags"] = tsgr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsGetResults struct. +func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var throughputSettingsGetProperties ThroughputSettingsGetProperties + err = json.Unmarshal(*v, &throughputSettingsGetProperties) + if err != nil { + return err + } + tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tsgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tsgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tsgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tsgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tsgr.Tags = tags + } + } + } + + return nil +} + +// ThroughputSettingsResource cosmos DB resource throughput object. Either throughput is required or +// autoscaleSettings is required, but not both. +type ThroughputSettingsResource struct { + // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. + AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` + // MinimumThroughput - READ-ONLY; The minimum throughput of the resource + MinimumThroughput *string `json:"minimumThroughput,omitempty"` + // OfferReplacePending - READ-ONLY; The throughput replace is pending + OfferReplacePending *string `json:"offerReplacePending,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsResource. +func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsr.Throughput != nil { + objectMap["throughput"] = tsr.Throughput + } + if tsr.AutoscaleSettings != nil { + objectMap["autoscaleSettings"] = tsr.AutoscaleSettings + } + return json.Marshal(objectMap) +} + +// ThroughputSettingsUpdateParameters parameters to update Cosmos DB resource throughput. +type ThroughputSettingsUpdateParameters struct { + // ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput. + *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsUpdateParameters. +func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsup.ThroughputSettingsUpdateProperties != nil { + objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties + } + if tsup.Location != nil { + objectMap["location"] = tsup.Location + } + if tsup.Tags != nil { + objectMap["tags"] = tsup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsUpdateParameters struct. +func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties + err = json.Unmarshal(*v, &throughputSettingsUpdateProperties) + if err != nil { + return err + } + tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tsup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tsup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tsup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tsup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tsup.Tags = tags + } + } + } + + return nil +} + +// ThroughputSettingsUpdateProperties properties to update Azure Cosmos DB resource throughput. +type ThroughputSettingsUpdateProperties struct { + // Resource - The standard JSON format of a resource throughput + Resource *ThroughputSettingsResource `json:"resource,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UniqueKey the unique key on that enforces uniqueness constraint on documents in the collection in the +// Azure Cosmos DB service. +type UniqueKey struct { + // Paths - List of paths must be unique for each document in the Azure Cosmos DB service + Paths *[]string `json:"paths,omitempty"` +} + +// UniqueKeyPolicy the unique key policy configuration for specifying uniqueness constraints on documents +// in the collection in the Azure Cosmos DB service. +type UniqueKeyPolicy struct { + // UniqueKeys - List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"` +} + +// Usage the usage data for a usage request. +type Usage struct { + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // Limit - READ-ONLY; Maximum value for this metric + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - READ-ONLY; Current value for this metric + CurrentValue *int64 `json:"currentValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Unit != "" { + objectMap["unit"] = u.Unit + } + return json.Marshal(objectMap) +} + +// UsagesResult the response to a list usage request. +type UsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric + Value *[]Usage `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsagesResult. +func (ur UsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualNetworkRule virtual Network ACL Rule object +type VirtualNetworkRule struct { + // ID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + ID *string `json:"id,omitempty"` + // IgnoreMissingVNetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. + IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"` +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/mongodbresources.go new file mode 100644 index 000000000000..f733fb23c3d5 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/mongodbresources.go @@ -0,0 +1,1573 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MongoDBResourcesClient is the client for the MongoDBResources methods of the Documentdb service. +type MongoDBResourcesClient struct { + BaseClient +} + +// NewMongoDBResourcesClient creates an instance of the MongoDBResourcesClient client. +func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { + return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMongoDBResourcesClientWithBaseURI creates an instance of the MongoDBResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { + return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateMongoDBCollection create or update an Azure Cosmos DB MongoDB Collection +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +// createUpdateMongoDBCollectionParameters - the parameters to provide for the current MongoDB Collection. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.CreateUpdateMongoDBCollection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateMongoDBCollectionParameters, + Constraints: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", err.Error()) + } + + req, err := client.CreateUpdateMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateMongoDBCollectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateMongoDBCollectionPreparer prepares the CreateUpdateMongoDBCollection request. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithJSON(createUpdateMongoDBCollectionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateMongoDBCollectionSender sends the CreateUpdateMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionSender(req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateMongoDBCollectionResponder handles the response to the CreateUpdateMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionResponder(resp *http.Response) (result MongoDBCollectionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateMongoDBDatabase create or updates Azure Cosmos DB MongoDB database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateMongoDBDatabaseParameters - the parameters to provide for the current MongoDB database. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.CreateUpdateMongoDBDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateMongoDBDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", err.Error()) + } + + req, err := client.CreateUpdateMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateMongoDBDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateMongoDBDatabasePreparer prepares the CreateUpdateMongoDBDatabase request. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateMongoDBDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateMongoDBDatabaseSender sends the CreateUpdateMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabaseSender(req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateMongoDBDatabaseResponder handles the response to the CreateUpdateMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabaseResponder(resp *http.Response) (result MongoDBDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteMongoDBCollection deletes an existing Azure Cosmos DB MongoDB Collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesDeleteMongoDBCollectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.DeleteMongoDBCollection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", err.Error()) + } + + req, err := client.DeleteMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = client.DeleteMongoDBCollectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteMongoDBCollectionPreparer prepares the DeleteMongoDBCollection request. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteMongoDBCollectionSender sends the DeleteMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionSender(req *http.Request) (future MongoDBResourcesDeleteMongoDBCollectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteMongoDBCollectionResponder handles the response to the DeleteMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteMongoDBDatabase deletes an existing Azure Cosmos DB MongoDB database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.DeleteMongoDBDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", err.Error()) + } + + req, err := client.DeleteMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteMongoDBDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteMongoDBDatabasePreparer prepares the DeleteMongoDBDatabase request. +func (client MongoDBResourcesClient) DeleteMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteMongoDBDatabaseSender sends the DeleteMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) DeleteMongoDBDatabaseSender(req *http.Request) (future MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteMongoDBDatabaseResponder handles the response to the DeleteMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) DeleteMongoDBDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetMongoDBCollection gets the MongoDB collection under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBCollectionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBCollection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBCollection", err.Error()) + } + + req, err := client.GetMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBCollectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBCollectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBCollectionPreparer prepares the GetMongoDBCollection request. +func (client MongoDBResourcesClient) GetMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBCollectionSender sends the GetMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBCollectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBCollectionResponder handles the response to the GetMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBCollectionResponder(resp *http.Response) (result MongoDBCollectionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBCollectionThroughput gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBCollectionThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", err.Error()) + } + + req, err := client.GetMongoDBCollectionThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBCollectionThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBCollectionThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBCollectionThroughputPreparer prepares the GetMongoDBCollectionThroughput request. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBCollectionThroughputSender sends the GetMongoDBCollectionThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBCollectionThroughputResponder handles the response to the GetMongoDBCollectionThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBDatabase gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided +// name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", err.Error()) + } + + req, err := client.GetMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBDatabasePreparer prepares the GetMongoDBDatabase request. +func (client MongoDBResourcesClient) GetMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBDatabaseSender sends the GetMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBDatabaseResponder handles the response to the GetMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBDatabaseResponder(resp *http.Response) (result MongoDBDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBDatabaseThroughput gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", err.Error()) + } + + req, err := client.GetMongoDBDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBDatabaseThroughputPreparer prepares the GetMongoDBDatabaseThroughput request. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBDatabaseThroughputSender sends the GetMongoDBDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBDatabaseThroughputResponder handles the response to the GetMongoDBDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMongoDBCollections lists the MongoDB collection under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBCollectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.ListMongoDBCollections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "ListMongoDBCollections", err.Error()) + } + + req, err := client.ListMongoDBCollectionsPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", nil, "Failure preparing request") + return + } + + resp, err := client.ListMongoDBCollectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", resp, "Failure sending request") + return + } + + result, err = client.ListMongoDBCollectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", resp, "Failure responding to request") + return + } + + return +} + +// ListMongoDBCollectionsPreparer prepares the ListMongoDBCollections request. +func (client MongoDBResourcesClient) ListMongoDBCollectionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMongoDBCollectionsSender sends the ListMongoDBCollections request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) ListMongoDBCollectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMongoDBCollectionsResponder handles the response to the ListMongoDBCollections request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) ListMongoDBCollectionsResponder(resp *http.Response) (result MongoDBCollectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMongoDBDatabases lists the MongoDB databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, resourceGroupName string, accountName string) (result MongoDBDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.ListMongoDBDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", err.Error()) + } + + req, err := client.ListMongoDBDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListMongoDBDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListMongoDBDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListMongoDBDatabasesPreparer prepares the ListMongoDBDatabases request. +func (client MongoDBResourcesClient) ListMongoDBDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMongoDBDatabasesSender sends the ListMongoDBDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) ListMongoDBDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMongoDBDatabasesResponder handles the response to the ListMongoDBDatabases request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) ListMongoDBDatabasesResponder(resp *http.Response) (result MongoDBDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBCollectionToAutoscale migrate an Azure Cosmos DB MongoDB collection from manual throughput to +// autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBCollectionToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", err.Error()) + } + + req, err := client.MigrateMongoDBCollectionToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBCollectionToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBCollectionToAutoscalePreparer prepares the MigrateMongoDBCollectionToAutoscale request. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBCollectionToAutoscaleSender sends the MigrateMongoDBCollectionToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscaleSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBCollectionToAutoscaleResponder handles the response to the MigrateMongoDBCollectionToAutoscale request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBCollectionToManualThroughput migrate an Azure Cosmos DB MongoDB collection from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBCollectionToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", err.Error()) + } + + req, err := client.MigrateMongoDBCollectionToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBCollectionToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBCollectionToManualThroughputPreparer prepares the MigrateMongoDBCollectionToManualThroughput request. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBCollectionToManualThroughputSender sends the MigrateMongoDBCollectionToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBCollectionToManualThroughputResponder handles the response to the MigrateMongoDBCollectionToManualThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBDatabaseToAutoscale migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateMongoDBDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBDatabaseToAutoscalePreparer prepares the MigrateMongoDBDatabaseToAutoscale request. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBDatabaseToAutoscaleSender sends the MigrateMongoDBDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscaleSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBDatabaseToAutoscaleResponder handles the response to the MigrateMongoDBDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBDatabaseToManualThroughput migrate an Azure Cosmos DB MongoDB database from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateMongoDBDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBDatabaseToManualThroughputPreparer prepares the MigrateMongoDBDatabaseToManualThroughput request. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBDatabaseToManualThroughputSender sends the MigrateMongoDBDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBDatabaseToManualThroughputResponder handles the response to the MigrateMongoDBDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMongoDBCollectionThroughput update the RUs per second of an Azure Cosmos DB MongoDB collection +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current MongoDB +// collection. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.UpdateMongoDBCollectionThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", err.Error()) + } + + req, err := client.UpdateMongoDBCollectionThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMongoDBCollectionThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMongoDBCollectionThroughputPreparer prepares the UpdateMongoDBCollectionThroughput request. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMongoDBCollectionThroughputSender sends the UpdateMongoDBCollectionThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputSender(req *http.Request) (future MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMongoDBCollectionThroughputResponder handles the response to the UpdateMongoDBCollectionThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMongoDBDatabaseThroughput update RUs per second of the an Azure Cosmos DB MongoDB database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current MongoDB +// database. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.UpdateMongoDBDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateMongoDBDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMongoDBDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMongoDBDatabaseThroughputPreparer prepares the UpdateMongoDBDatabaseThroughput request. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMongoDBDatabaseThroughputSender sends the UpdateMongoDBDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputSender(req *http.Request) (future MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMongoDBDatabaseThroughputResponder handles the response to the UpdateMongoDBDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/notebookworkspaces.go new file mode 100644 index 000000000000..bdf11ba7e5bf --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/notebookworkspaces.go @@ -0,0 +1,674 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NotebookWorkspacesClient is the client for the NotebookWorkspaces methods of the Documentdb service. +type NotebookWorkspacesClient struct { + BaseClient +} + +// NewNotebookWorkspacesClient creates an instance of the NotebookWorkspacesClient client. +func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { + return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotebookWorkspacesClientWithBaseURI creates an instance of the NotebookWorkspacesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { + return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// notebookCreateUpdateParameters - the notebook workspace to create for the current database account. +func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, notebookCreateUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotebookWorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithJSON(notebookCreateUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) CreateOrUpdateSender(req *http.Request) (future NotebookWorkspacesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result NotebookWorkspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NotebookWorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) DeleteSender(req *http.Request) (future NotebookWorkspacesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client NotebookWorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result NotebookWorkspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client NotebookWorkspacesClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http.Response) (result NotebookWorkspaceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionInfo retrieves the connection info for the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.ListConnectionInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "ListConnectionInfo", err.Error()) + } + + req, err := client.ListConnectionInfoPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionInfoPreparer prepares the ListConnectionInfo request. +func (client NotebookWorkspacesClient) ListConnectionInfoPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionInfoSender sends the ListConnectionInfo request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) ListConnectionInfoSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionInfoResponder handles the response to the ListConnectionInfo request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Response) (result NotebookWorkspaceConnectionInfoResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateAuthToken regenerates the auth token for the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.RegenerateAuthToken") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", err.Error()) + } + + req, err := client.RegenerateAuthTokenPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", nil, "Failure preparing request") + return + } + + result, err = client.RegenerateAuthTokenSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", result.Response(), "Failure sending request") + return + } + + return +} + +// RegenerateAuthTokenPreparer prepares the RegenerateAuthToken request. +func (client NotebookWorkspacesClient) RegenerateAuthTokenPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateAuthTokenSender sends the RegenerateAuthToken request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) RegenerateAuthTokenSender(req *http.Request) (future NotebookWorkspacesRegenerateAuthTokenFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegenerateAuthTokenResponder handles the response to the RegenerateAuthToken request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client NotebookWorkspacesClient) StartPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) StartSender(req *http.Request) (future NotebookWorkspacesStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/operations.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/operations.go new file mode 100644 index 000000000000..aefac7549934 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/operations.go @@ -0,0 +1,140 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Documentdb service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Cosmos DB Resource Provider operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DocumentDB/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeid.go new file mode 100644 index 000000000000..150a3a004930 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeid.go @@ -0,0 +1,132 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PartitionKeyRangeIDClient is the client for the PartitionKeyRangeID methods of the Documentdb service. +type PartitionKeyRangeIDClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDClient creates an instance of the PartitionKeyRangeIDClient client. +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDClientWithBaseURI creates an instance of the PartitionKeyRangeIDClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// partitionKeyRangeID - partition Key Range Id for which to get data. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PartitionKeyRangeIDClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeidregion.go new file mode 100644 index 000000000000..d0c3fb6498e5 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/partitionkeyrangeidregion.go @@ -0,0 +1,134 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PartitionKeyRangeIDRegionClient is the client for the PartitionKeyRangeIDRegion methods of the Documentdb service. +type PartitionKeyRangeIDRegionClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDRegionClient creates an instance of the PartitionKeyRangeIDRegionClient client. +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDRegionClientWithBaseURI creates an instance of the PartitionKeyRangeIDRegionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id and region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// partitionKeyRangeID - partition Key Range Id for which to get data. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PartitionKeyRangeIDRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/percentile.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentile.go new file mode 100644 index 000000000000..76222a4e72f8 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentile.go @@ -0,0 +1,126 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileClient is the client for the Percentile methods of the Documentdb service. +type PercentileClient struct { + BaseClient +} + +// NewPercentileClient creates an instance of the PercentileClient client. +func NewPercentileClient(subscriptionID string) PercentileClient { + return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileClientWithBaseURI creates an instance of the PercentileClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return PercentileClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account. This url is only +// for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentilesourcetarget.go new file mode 100644 index 000000000000..4210a6d0945b --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentilesourcetarget.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileSourceTargetClient is the client for the PercentileSourceTarget methods of the Documentdb service. +type PercentileSourceTargetClient struct { + BaseClient +} + +// NewPercentileSourceTargetClient creates an instance of the PercentileSourceTargetClient client. +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileSourceTargetClientWithBaseURI creates an instance of the PercentileSourceTargetClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account, source and target region. +// This url is only for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// sourceRegion - source region from which data is written. Cosmos DB region, with spaces between words and +// each word capitalized. +// targetRegion - target region to which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileSourceTargetClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileSourceTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, sourceRegion, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileSourceTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceRegion": autorest.Encode("path", sourceRegion), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileSourceTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileSourceTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentiletarget.go new file mode 100644 index 000000000000..951495d14016 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/percentiletarget.go @@ -0,0 +1,130 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileTargetClient is the client for the PercentileTarget methods of the Documentdb service. +type PercentileTargetClient struct { + BaseClient +} + +// NewPercentileTargetClient creates an instance of the PercentileTargetClient client. +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileTargetClientWithBaseURI creates an instance of the PercentileTargetClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account target region. This url is +// only for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// targetRegion - target region to which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileTargetClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/privateendpointconnections.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/privateendpointconnections.go new file mode 100644 index 000000000000..0365f3a52963 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/privateendpointconnections.go @@ -0,0 +1,402 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the client for the PrivateEndpointConnections methods of the Documentdb service. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate approve or reject a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount list all private endpoint connections on a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateEndpointConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/privatelinkresources.go new file mode 100644 index 000000000000..c159ae6842df --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/privatelinkresources.go @@ -0,0 +1,213 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the client for the PrivateLinkResources methods of the Documentdb service. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the private link resources that need to be created for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// groupName - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "groupName": autorest.Encode("path", groupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount gets the private link resources that need to be created for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/sqlresources.go new file mode 100644 index 000000000000..1caf9ad501c7 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/sqlresources.go @@ -0,0 +1,3487 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SQLResourcesClient is the client for the SQLResources methods of the Documentdb service. +type SQLResourcesClient struct { + BaseClient +} + +// NewSQLResourcesClient creates an instance of the SQLResourcesClient client. +func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { + return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSQLResourcesClientWithBaseURI creates an instance of the SQLResourcesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { + return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateSQLContainer create or update an Azure Cosmos DB SQL container +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// createUpdateSQLContainerParameters - the parameters to provide for the current SQL container. +func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLContainerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLContainer") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLContainerParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, + {Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", err.Error()) + } + + req, err := client.CreateUpdateSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, createUpdateSQLContainerParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLContainerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLContainerPreparer prepares the CreateUpdateSQLContainer request. +func (client SQLResourcesClient) CreateUpdateSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithJSON(createUpdateSQLContainerParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLContainerSender sends the CreateUpdateSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLContainerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLContainerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLContainerResponder handles the response to the CreateUpdateSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLDatabase create or update an Azure Cosmos DB SQL database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateSQLDatabaseParameters - the parameters to provide for the current SQL database. +func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", err.Error()) + } + + req, err := client.CreateUpdateSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateSQLDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLDatabasePreparer prepares the CreateUpdateSQLDatabase request. +func (client SQLResourcesClient) CreateUpdateSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateSQLDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLDatabaseSender sends the CreateUpdateSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLDatabaseSender(req *http.Request) (future SQLResourcesCreateUpdateSQLDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLDatabaseResponder handles the response to the CreateUpdateSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLRoleAssignment creates or updates an Azure Cosmos DB SQL Role Assignment. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateSQLRoleAssignmentParameters - the properties required to create or update a Role Assignment. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLRoleAssignment") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", err.Error()) + } + + req, err := client.CreateUpdateSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName, createUpdateSQLRoleAssignmentParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLRoleAssignmentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLRoleAssignmentPreparer prepares the CreateUpdateSQLRoleAssignment request. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithJSON(createUpdateSQLRoleAssignmentParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLRoleAssignmentSender sends the CreateUpdateSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentSender(req *http.Request) (future SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLRoleAssignmentResponder handles the response to the CreateUpdateSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentResponder(resp *http.Response) (result SQLRoleAssignmentGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLRoleDefinition creates or updates an Azure Cosmos DB SQL Role Definition. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateSQLRoleDefinitionParameters - the properties required to create or update a Role Definition. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLRoleDefinition") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", err.Error()) + } + + req, err := client.CreateUpdateSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName, createUpdateSQLRoleDefinitionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLRoleDefinitionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLRoleDefinitionPreparer prepares the CreateUpdateSQLRoleDefinition request. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithJSON(createUpdateSQLRoleDefinitionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLRoleDefinitionSender sends the CreateUpdateSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionSender(req *http.Request) (future SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLRoleDefinitionResponder handles the response to the CreateUpdateSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionResponder(resp *http.Response) (result SQLRoleDefinitionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLStoredProcedure create or update an Azure Cosmos DB SQL storedProcedure +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +// createUpdateSQLStoredProcedureParameters - the parameters to provide for the current SQL storedProcedure. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLStoredProcedure") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLStoredProcedureParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", err.Error()) + } + + req, err := client.CreateUpdateSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSQLStoredProcedureParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLStoredProcedureSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLStoredProcedurePreparer prepares the CreateUpdateSQLStoredProcedure request. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithJSON(createUpdateSQLStoredProcedureParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLStoredProcedureSender sends the CreateUpdateSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureSender(req *http.Request) (future SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLStoredProcedureResponder handles the response to the CreateUpdateSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLTrigger create or update an Azure Cosmos DB SQL trigger +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +// createUpdateSQLTriggerParameters - the parameters to provide for the current SQL trigger. +func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLTrigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLTriggerParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", err.Error()) + } + + req, err := client.CreateUpdateSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSQLTriggerParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLTriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLTriggerPreparer prepares the CreateUpdateSQLTrigger request. +func (client SQLResourcesClient) CreateUpdateSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithJSON(createUpdateSQLTriggerParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLTriggerSender sends the CreateUpdateSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLTriggerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLTriggerResponder handles the response to the CreateUpdateSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLUserDefinedFunction create or update an Azure Cosmos DB SQL userDefinedFunction +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +// createUpdateSQLUserDefinedFunctionParameters - the parameters to provide for the current SQL +// userDefinedFunction. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLUserDefinedFunctionParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", err.Error()) + } + + req, err := client.CreateUpdateSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSQLUserDefinedFunctionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLUserDefinedFunctionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLUserDefinedFunctionPreparer prepares the CreateUpdateSQLUserDefinedFunction request. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithJSON(createUpdateSQLUserDefinedFunctionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLUserDefinedFunctionSender sends the CreateUpdateSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLUserDefinedFunctionResponder handles the response to the CreateUpdateSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteSQLContainer deletes an existing Azure Cosmos DB SQL container. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesDeleteSQLContainerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLContainer") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLContainer", err.Error()) + } + + req, err := client.DeleteSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLContainerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLContainerPreparer prepares the DeleteSQLContainer request. +func (client SQLResourcesClient) DeleteSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLContainerSender sends the DeleteSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLContainerSender(req *http.Request) (future SQLResourcesDeleteSQLContainerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLContainerResponder handles the response to the DeleteSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLContainerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLDatabase deletes an existing Azure Cosmos DB SQL database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesDeleteSQLDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLDatabase", err.Error()) + } + + req, err := client.DeleteSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLDatabasePreparer prepares the DeleteSQLDatabase request. +func (client SQLResourcesClient) DeleteSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLDatabaseSender sends the DeleteSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLDatabaseSender(req *http.Request) (future SQLResourcesDeleteSQLDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLDatabaseResponder handles the response to the DeleteSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLRoleAssignment deletes an existing Azure Cosmos DB SQL Role Assignment. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) DeleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result SQLResourcesDeleteSQLRoleAssignmentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLRoleAssignment") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", err.Error()) + } + + req, err := client.DeleteSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLRoleAssignmentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLRoleAssignmentPreparer prepares the DeleteSQLRoleAssignment request. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLRoleAssignmentSender sends the DeleteSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentSender(req *http.Request) (future SQLResourcesDeleteSQLRoleAssignmentFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLRoleAssignmentResponder handles the response to the DeleteSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLRoleDefinition deletes an existing Azure Cosmos DB SQL Role Definition. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) DeleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result SQLResourcesDeleteSQLRoleDefinitionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLRoleDefinition") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", err.Error()) + } + + req, err := client.DeleteSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLRoleDefinitionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLRoleDefinitionPreparer prepares the DeleteSQLRoleDefinition request. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLRoleDefinitionSender sends the DeleteSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionSender(req *http.Request) (future SQLResourcesDeleteSQLRoleDefinitionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLRoleDefinitionResponder handles the response to the DeleteSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLStoredProcedure deletes an existing Azure Cosmos DB SQL storedProcedure. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLResourcesDeleteSQLStoredProcedureFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLStoredProcedure") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", err.Error()) + } + + req, err := client.DeleteSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLStoredProcedureSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLStoredProcedurePreparer prepares the DeleteSQLStoredProcedure request. +func (client SQLResourcesClient) DeleteSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLStoredProcedureSender sends the DeleteSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLStoredProcedureSender(req *http.Request) (future SQLResourcesDeleteSQLStoredProcedureFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLStoredProcedureResponder handles the response to the DeleteSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLStoredProcedureResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLTrigger deletes an existing Azure Cosmos DB SQL trigger. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLResourcesDeleteSQLTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLTrigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLTrigger", err.Error()) + } + + req, err := client.DeleteSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLTriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLTriggerPreparer prepares the DeleteSQLTrigger request. +func (client SQLResourcesClient) DeleteSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLTriggerSender sends the DeleteSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLTriggerSender(req *http.Request) (future SQLResourcesDeleteSQLTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLTriggerResponder handles the response to the DeleteSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLTriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLUserDefinedFunction deletes an existing Azure Cosmos DB SQL userDefinedFunction. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", err.Error()) + } + + req, err := client.DeleteSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLUserDefinedFunctionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLUserDefinedFunctionPreparer prepares the DeleteSQLUserDefinedFunction request. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLUserDefinedFunctionSender sends the DeleteSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLUserDefinedFunctionResponder handles the response to the DeleteSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetSQLContainer gets the SQL container under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLContainerGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainer", err.Error()) + } + + req, err := client.GetSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLContainerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure sending request") + return + } + + result, err = client.GetSQLContainerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLContainerPreparer prepares the GetSQLContainer request. +func (client SQLResourcesClient) GetSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLContainerSender sends the GetSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLContainerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLContainerResponder handles the response to the GetSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLContainerThroughput gets the RUs per second of the SQL container under an existing Azure Cosmos DB database +// account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainerThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainerThroughput", err.Error()) + } + + req, err := client.GetSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLContainerThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetSQLContainerThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLContainerThroughputPreparer prepares the GetSQLContainerThroughput request. +func (client SQLResourcesClient) GetSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLContainerThroughputSender sends the GetSQLContainerThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLContainerThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLContainerThroughputResponder handles the response to the GetSQLContainerThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLDatabase gets the SQL database under an existing Azure Cosmos DB database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabase", err.Error()) + } + + req, err := client.GetSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetSQLDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLDatabasePreparer prepares the GetSQLDatabase request. +func (client SQLResourcesClient) GetSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLDatabaseSender sends the GetSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLDatabaseResponder handles the response to the GetSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLDatabaseThroughput gets the RUs per second of the SQL database under an existing Azure Cosmos DB database +// account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", err.Error()) + } + + req, err := client.GetSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetSQLDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLDatabaseThroughputPreparer prepares the GetSQLDatabaseThroughput request. +func (client SQLResourcesClient) GetSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLDatabaseThroughputSender sends the GetSQLDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLDatabaseThroughputResponder handles the response to the GetSQLDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLRoleAssignment retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result SQLRoleAssignmentGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLRoleAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLRoleAssignment", err.Error()) + } + + req, err := client.GetSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLRoleAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", resp, "Failure sending request") + return + } + + result, err = client.GetSQLRoleAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLRoleAssignmentPreparer prepares the GetSQLRoleAssignment request. +func (client SQLResourcesClient) GetSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLRoleAssignmentSender sends the GetSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLRoleAssignmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLRoleAssignmentResponder handles the response to the GetSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLRoleAssignmentResponder(resp *http.Response) (result SQLRoleAssignmentGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLRoleDefinition retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result SQLRoleDefinitionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLRoleDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLRoleDefinition", err.Error()) + } + + req, err := client.GetSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLRoleDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", resp, "Failure sending request") + return + } + + result, err = client.GetSQLRoleDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLRoleDefinitionPreparer prepares the GetSQLRoleDefinition request. +func (client SQLResourcesClient) GetSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLRoleDefinitionSender sends the GetSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLRoleDefinitionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLRoleDefinitionResponder handles the response to the GetSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLRoleDefinitionResponder(resp *http.Response) (result SQLRoleDefinitionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLStoredProcedure gets the SQL storedProcedure under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLStoredProcedureGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLStoredProcedure") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLStoredProcedure", err.Error()) + } + + req, err := client.GetSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLStoredProcedureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure sending request") + return + } + + result, err = client.GetSQLStoredProcedureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLStoredProcedurePreparer prepares the GetSQLStoredProcedure request. +func (client SQLResourcesClient) GetSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLStoredProcedureSender sends the GetSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLStoredProcedureSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLStoredProcedureResponder handles the response to the GetSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLTrigger gets the SQL trigger under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLTriggerGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLTrigger") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLTrigger", err.Error()) + } + + req, err := client.GetSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLTriggerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure sending request") + return + } + + result, err = client.GetSQLTriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLTriggerPreparer prepares the GetSQLTrigger request. +func (client SQLResourcesClient) GetSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLTriggerSender sends the GetSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLTriggerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLTriggerResponder handles the response to the GetSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLUserDefinedFunction gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLUserDefinedFunctionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", err.Error()) + } + + req, err := client.GetSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLUserDefinedFunctionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure sending request") + return + } + + result, err = client.GetSQLUserDefinedFunctionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLUserDefinedFunctionPreparer prepares the GetSQLUserDefinedFunction request. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLUserDefinedFunctionSender sends the GetSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLUserDefinedFunctionResponder handles the response to the GetSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLContainers lists the SQL container under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLContainerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLContainers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLContainers", err.Error()) + } + + req, err := client.ListSQLContainersPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure sending request") + return + } + + result, err = client.ListSQLContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLContainersPreparer prepares the ListSQLContainers request. +func (client SQLResourcesClient) ListSQLContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLContainersSender sends the ListSQLContainers request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLContainersResponder handles the response to the ListSQLContainers request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLContainersResponder(resp *http.Response) (result SQLContainerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLDatabases lists the SQL databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result SQLDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLDatabases", err.Error()) + } + + req, err := client.ListSQLDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListSQLDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLDatabasesPreparer prepares the ListSQLDatabases request. +func (client SQLResourcesClient) ListSQLDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLDatabasesSender sends the ListSQLDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLDatabasesResponder handles the response to the ListSQLDatabases request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLDatabasesResponder(resp *http.Response) (result SQLDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLRoleAssignments retrieves the list of all Azure Cosmos DB SQL Role Assignments. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLRoleAssignments(ctx context.Context, resourceGroupName string, accountName string) (result SQLRoleAssignmentListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLRoleAssignments") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLRoleAssignments", err.Error()) + } + + req, err := client.ListSQLRoleAssignmentsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLRoleAssignmentsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", resp, "Failure sending request") + return + } + + result, err = client.ListSQLRoleAssignmentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLRoleAssignmentsPreparer prepares the ListSQLRoleAssignments request. +func (client SQLResourcesClient) ListSQLRoleAssignmentsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLRoleAssignmentsSender sends the ListSQLRoleAssignments request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLRoleAssignmentsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLRoleAssignmentsResponder handles the response to the ListSQLRoleAssignments request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLRoleAssignmentsResponder(resp *http.Response) (result SQLRoleAssignmentListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLRoleDefinitions retrieves the list of all Azure Cosmos DB SQL Role Definitions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLRoleDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result SQLRoleDefinitionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLRoleDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", err.Error()) + } + + req, err := client.ListSQLRoleDefinitionsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLRoleDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListSQLRoleDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLRoleDefinitionsPreparer prepares the ListSQLRoleDefinitions request. +func (client SQLResourcesClient) ListSQLRoleDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLRoleDefinitionsSender sends the ListSQLRoleDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLRoleDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLRoleDefinitionsResponder handles the response to the ListSQLRoleDefinitions request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLRoleDefinitionsResponder(resp *http.Response) (result SQLRoleDefinitionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLStoredProcedures lists the SQL storedProcedure under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLStoredProcedureListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLStoredProcedures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLStoredProcedures", err.Error()) + } + + req, err := client.ListSQLStoredProceduresPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLStoredProceduresSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure sending request") + return + } + + result, err = client.ListSQLStoredProceduresResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLStoredProceduresPreparer prepares the ListSQLStoredProcedures request. +func (client SQLResourcesClient) ListSQLStoredProceduresPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLStoredProceduresSender sends the ListSQLStoredProcedures request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLStoredProceduresSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLStoredProceduresResponder handles the response to the ListSQLStoredProcedures request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLStoredProceduresResponder(resp *http.Response) (result SQLStoredProcedureListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLTriggers lists the SQL trigger under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLTriggerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLTriggers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLTriggers", err.Error()) + } + + req, err := client.ListSQLTriggersPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLTriggersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure sending request") + return + } + + result, err = client.ListSQLTriggersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLTriggersPreparer prepares the ListSQLTriggers request. +func (client SQLResourcesClient) ListSQLTriggersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLTriggersSender sends the ListSQLTriggers request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLTriggersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLTriggersResponder handles the response to the ListSQLTriggers request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLTriggersResponder(resp *http.Response) (result SQLTriggerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLUserDefinedFunctions lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLUserDefinedFunctionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLUserDefinedFunctions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", err.Error()) + } + + req, err := client.ListSQLUserDefinedFunctionsPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLUserDefinedFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure sending request") + return + } + + result, err = client.ListSQLUserDefinedFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLUserDefinedFunctionsPreparer prepares the ListSQLUserDefinedFunctions request. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLUserDefinedFunctionsSender sends the ListSQLUserDefinedFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLUserDefinedFunctionsResponder handles the response to the ListSQLUserDefinedFunctions request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsResponder(resp *http.Response) (result SQLUserDefinedFunctionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLContainerToAutoscale migrate an Azure Cosmos DB SQL container from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", err.Error()) + } + + req, err := client.MigrateSQLContainerToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLContainerToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLContainerToAutoscalePreparer prepares the MigrateSQLContainerToAutoscale request. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLContainerToAutoscaleSender sends the MigrateSQLContainerToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLContainerToAutoscaleResponder handles the response to the MigrateSQLContainerToAutoscale request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLContainerToManualThroughput migrate an Azure Cosmos DB SQL container from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", err.Error()) + } + + req, err := client.MigrateSQLContainerToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLContainerToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLContainerToManualThroughputPreparer prepares the MigrateSQLContainerToManualThroughput request. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLContainerToManualThroughputSender sends the MigrateSQLContainerToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLContainerToManualThroughputResponder handles the response to the MigrateSQLContainerToManualThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLDatabaseToAutoscale migrate an Azure Cosmos DB SQL database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateSQLDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLDatabaseToAutoscalePreparer prepares the MigrateSQLDatabaseToAutoscale request. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLDatabaseToAutoscaleSender sends the MigrateSQLDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLDatabaseToAutoscaleResponder handles the response to the MigrateSQLDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLDatabaseToManualThroughput migrate an Azure Cosmos DB SQL database from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateSQLDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLDatabaseToManualThroughputPreparer prepares the MigrateSQLDatabaseToManualThroughput request. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLDatabaseToManualThroughputSender sends the MigrateSQLDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLDatabaseToManualThroughputResponder handles the response to the MigrateSQLDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSQLContainerThroughput update RUs per second of an Azure Cosmos DB SQL container +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL container. +func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLContainerThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLContainerThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", err.Error()) + } + + req, err := client.UpdateSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSQLContainerThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateSQLContainerThroughputPreparer prepares the UpdateSQLContainerThroughput request. +func (client SQLResourcesClient) UpdateSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSQLContainerThroughputSender sends the UpdateSQLContainerThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) UpdateSQLContainerThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLContainerThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateSQLContainerThroughputResponder handles the response to the UpdateSQLContainerThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) UpdateSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSQLDatabaseThroughput update RUs per second of an Azure Cosmos DB SQL database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL database. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSQLDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateSQLDatabaseThroughputPreparer prepares the UpdateSQLDatabaseThroughput request. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSQLDatabaseThroughputSender sends the UpdateSQLDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateSQLDatabaseThroughputResponder handles the response to the UpdateSQLDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/tableresources.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/tableresources.go new file mode 100644 index 000000000000..91a0e70aec76 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/tableresources.go @@ -0,0 +1,791 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TableResourcesClient is the client for the TableResources methods of the Documentdb service. +type TableResourcesClient struct { + BaseClient +} + +// NewTableResourcesClient creates an instance of the TableResourcesClient client. +func NewTableResourcesClient(subscriptionID string) TableResourcesClient { + return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTableResourcesClientWithBaseURI creates an instance of the TableResourcesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { + return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateTable create or update an Azure Cosmos DB Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +// createUpdateTableParameters - the parameters to provide for the current Table. +func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters) (result TableResourcesCreateUpdateTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.CreateUpdateTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateTableParameters, + Constraints: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "CreateUpdateTable", err.Error()) + } + + req, err := client.CreateUpdateTablePreparer(ctx, resourceGroupName, accountName, tableName, createUpdateTableParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "CreateUpdateTable", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "CreateUpdateTable", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateTablePreparer prepares the CreateUpdateTable request. +func (client TableResourcesClient) CreateUpdateTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithJSON(createUpdateTableParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateTableSender sends the CreateUpdateTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) CreateUpdateTableSender(req *http.Request) (future TableResourcesCreateUpdateTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateTableResponder handles the response to the CreateUpdateTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) CreateUpdateTableResponder(resp *http.Response) (result TableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteTable deletes an existing Azure Cosmos DB Table. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesDeleteTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.DeleteTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "DeleteTable", err.Error()) + } + + req, err := client.DeleteTablePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "DeleteTable", nil, "Failure preparing request") + return + } + + result, err = client.DeleteTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "DeleteTable", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteTablePreparer prepares the DeleteTable request. +func (client TableResourcesClient) DeleteTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteTableSender sends the DeleteTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) DeleteTableSender(req *http.Request) (future TableResourcesDeleteTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteTableResponder handles the response to the DeleteTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) DeleteTableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetTable gets the Tables under an existing Azure Cosmos DB database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.GetTable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "GetTable", err.Error()) + } + + req, err := client.GetTablePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", nil, "Failure preparing request") + return + } + + resp, err := client.GetTableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", resp, "Failure sending request") + return + } + + result, err = client.GetTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", resp, "Failure responding to request") + return + } + + return +} + +// GetTablePreparer prepares the GetTable request. +func (client TableResourcesClient) GetTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTableSender sends the GetTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) GetTableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTableResponder handles the response to the GetTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) GetTableResponder(resp *http.Response) (result TableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTableThroughput gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the +// provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.GetTableThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "GetTableThroughput", err.Error()) + } + + req, err := client.GetTableThroughputPreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetTableThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetTableThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetTableThroughputPreparer prepares the GetTableThroughput request. +func (client TableResourcesClient) GetTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTableThroughputSender sends the GetTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) GetTableThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTableThroughputResponder handles the response to the GetTableThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) GetTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListTables lists the Tables under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroupName string, accountName string) (result TableListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.ListTables") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "ListTables", err.Error()) + } + + req, err := client.ListTablesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", nil, "Failure preparing request") + return + } + + resp, err := client.ListTablesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", resp, "Failure sending request") + return + } + + result, err = client.ListTablesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", resp, "Failure responding to request") + return + } + + return +} + +// ListTablesPreparer prepares the ListTables request. +func (client TableResourcesClient) ListTablesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTablesSender sends the ListTables request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) ListTablesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTablesResponder handles the response to the ListTables request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) ListTablesResponder(resp *http.Response) (result TableListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateTableToAutoscale migrate an Azure Cosmos DB Table from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesMigrateTableToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.MigrateTableToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "MigrateTableToAutoscale", err.Error()) + } + + req, err := client.MigrateTableToAutoscalePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateTableToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateTableToAutoscalePreparer prepares the MigrateTableToAutoscale request. +func (client TableResourcesClient) MigrateTableToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateTableToAutoscaleSender sends the MigrateTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) MigrateTableToAutoscaleSender(req *http.Request) (future TableResourcesMigrateTableToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateTableToAutoscaleResponder handles the response to the MigrateTableToAutoscale request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) MigrateTableToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateTableToManualThroughput migrate an Azure Cosmos DB Table from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesMigrateTableToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.MigrateTableToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "MigrateTableToManualThroughput", err.Error()) + } + + req, err := client.MigrateTableToManualThroughputPreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateTableToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateTableToManualThroughputPreparer prepares the MigrateTableToManualThroughput request. +func (client TableResourcesClient) MigrateTableToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateTableToManualThroughputSender sends the MigrateTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) MigrateTableToManualThroughputSender(req *http.Request) (future TableResourcesMigrateTableToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateTableToManualThroughputResponder handles the response to the MigrateTableToManualThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) MigrateTableToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateTableThroughput update RUs per second of an Azure Cosmos DB Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current Table. +func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result TableResourcesUpdateTableThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.UpdateTableThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "UpdateTableThroughput", err.Error()) + } + + req, err := client.UpdateTableThroughputPreparer(ctx, resourceGroupName, accountName, tableName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "UpdateTableThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTableThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "UpdateTableThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTableThroughputPreparer prepares the UpdateTableThroughput request. +func (client TableResourcesClient) UpdateTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTableThroughputSender sends the UpdateTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) UpdateTableThroughputSender(req *http.Request) (future TableResourcesUpdateTableThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateTableThroughputResponder handles the response to the UpdateTableThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) UpdateTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cosmos-db/mgmt/2021-04-15/documentdb/version.go b/services/cosmos-db/mgmt/2021-04-15/documentdb/version.go new file mode 100644 index 000000000000..e87493c89d94 --- /dev/null +++ b/services/cosmos-db/mgmt/2021-04-15/documentdb/version.go @@ -0,0 +1,19 @@ +package documentdb + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " documentdb/2021-04-15" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-05-15/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-05-15/documentdb/_meta.json index 55f0d7dd2cc0..e30790796fb0 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "ef7ffaa1ae68ab17dba86d8e0be5fd1fb615ef64", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-05", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/cassandraresources.go index ea466f19d226..3b95a8c0d423 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/cassandraresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -261,8 +259,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -356,8 +353,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -545,8 +540,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -638,8 +632,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -733,8 +726,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -825,8 +817,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -916,8 +907,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1009,8 +999,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1105,8 +1094,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1201,8 +1189,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1299,8 +1286,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1397,8 +1383,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1504,8 +1489,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/collection.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/collection.go index 61d402b15a49..f459520a5e38 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/collection.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartition.go index 4657b2386226..c4114fd709c2 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartition.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartitionregion.go index cbc530887fcd..8ba4d8df8eb7 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartitionregion.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionregion.go index 11d77bed1ab7..7fa3ea6aa83e 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionregion.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/database.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/database.go index 9929d1779635..9cf8c792e58e 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/database.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccountregion.go index 76405e9ea3f0..8bcc79d3156c 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccountregion.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccounts.go index be11af1bbeff..a9726df00b77 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/gremlinresources.go index 0427daa05bce..562eafc0b0aa 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/gremlinresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -363,8 +360,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -459,8 +455,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -552,8 +547,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -645,8 +639,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -740,8 +733,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -832,8 +824,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -923,8 +914,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1015,8 +1005,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1111,8 +1100,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1207,8 +1195,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1304,8 +1291,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1402,8 +1388,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1508,8 +1493,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/mongodbresources.go index 2691bfbd464c..ead74b5fb373 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/mongodbresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -262,8 +260,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -357,8 +354,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -641,8 +635,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -734,8 +727,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -826,8 +818,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -917,8 +908,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1010,8 +1000,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1108,8 +1097,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1204,8 +1192,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1300,8 +1287,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1398,8 +1384,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1505,8 +1490,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/notebookworkspaces.go index a4d79443dc70..5a4e9311c3de 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeid.go index 672fa56ec175..ffca817327a0 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeid.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeidregion.go index 4adeccb15d80..649dbfb91014 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeidregion.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentile.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentile.go index ea2ba5f724aa..75b6e9ba5875 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentile.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentilesourcetarget.go index f5abab66c0a5..4e10e72c2fb8 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentilesourcetarget.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentiletarget.go index 06bd4b811ece..fb7a24cb3b40 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/percentiletarget.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/privateendpointconnections.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/privateendpointconnections.go index ae6285634d97..05083ca89da3 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/privateendpointconnections.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/privatelinkresources.go index 200d17a8eb86..8355393a6c59 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/privatelinkresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/sqlresources.go index 9e7ab3f45f61..df3d259e89a2 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/sqlresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -165,8 +164,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleAssignment(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -366,8 +363,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleDefinition(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -466,8 +462,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -573,8 +568,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -681,8 +675,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -786,8 +779,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -881,8 +873,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -975,8 +966,7 @@ func (client SQLResourcesClient) DeleteSQLRoleAssignment(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1069,8 +1059,7 @@ func (client SQLResourcesClient) DeleteSQLRoleDefinition(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1165,8 +1154,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1263,8 +1251,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1361,8 +1348,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1458,8 +1444,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1553,8 +1538,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1646,8 +1630,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1739,8 +1722,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1831,8 +1813,7 @@ func (client SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleA Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1923,8 +1904,7 @@ func (client SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleD Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2017,8 +1997,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2113,8 +2092,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2209,8 +2187,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2303,8 +2280,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2394,8 +2370,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2484,8 +2459,7 @@ func (client SQLResourcesClient) ListSQLRoleAssignments(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2574,8 +2548,7 @@ func (client SQLResourcesClient) ListSQLRoleDefinitions(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2666,8 +2639,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2760,8 +2732,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2854,8 +2825,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2948,8 +2918,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3045,8 +3014,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3141,8 +3109,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3236,8 +3203,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3333,8 +3299,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3439,8 +3404,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-05-15/documentdb/tableresources.go b/services/cosmos-db/mgmt/2021-05-15/documentdb/tableresources.go index 76056c927a99..a8537eb85f9b 100644 --- a/services/cosmos-db/mgmt/2021-05-15/documentdb/tableresources.go +++ b/services/cosmos-db/mgmt/2021-05-15/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -155,8 +154,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -249,8 +247,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -342,8 +339,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -433,8 +429,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -524,8 +519,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -619,8 +613,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -715,8 +708,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/cosmos-db/mgmt/2021-06-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-06-15/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2021-06-15/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2021-06-15/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2021-06-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-06-15/documentdb/_meta.json index 54149390884e..169546351254 100644 --- a/services/cosmos-db/mgmt/2021-06-15/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2021-06-15/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "8dff86df71bee429af84ea4713288ef3cdd1db2f", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-06", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/cosmos-db/mgmt/2021-10-15/documentdb/CHANGELOG.md b/services/cosmos-db/mgmt/2021-10-15/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/cosmos-db/mgmt/2021-10-15/documentdb/CHANGELOG.md +++ b/services/cosmos-db/mgmt/2021-10-15/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/cosmos-db/mgmt/2021-10-15/documentdb/_meta.json b/services/cosmos-db/mgmt/2021-10-15/documentdb/_meta.json index 65fb194d4dbc..a2b42a0a9670 100644 --- a/services/cosmos-db/mgmt/2021-10-15/documentdb/_meta.json +++ b/services/cosmos-db/mgmt/2021-10-15/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "2b56c8a3da0e04aea6f6d80a9ac04741d1ae5904", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-10", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/_meta.json index 515767e312b8..3a3ad5df6a51 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2019-08-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go index 5e26f0f3138a..19d3fc9c1361 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go index a084a08ec5ab..08c31e3d293c 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go index 42aee63e6a66..9f401fe21d4d 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/_meta.json index da04dbd59fa7..bbd801213bd6 100644 --- a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2019-12", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/notebookworkspaces.go index 8acd988ec0c4..12946527c30b 100644 --- a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privateendpointconnections.go index bea6fd6e761c..dfb14fbc6920 100644 --- a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privatelinkresources.go index 1e0f9b660a2a..db78c5a8b1a7 100644 --- a/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/_meta.json index 5e08e18616b2..cf37bb3d16d4 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2020-03", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/cassandraresources.go index ca01d7a13344..c31ed34b6732 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/cassandraresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -263,8 +261,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -358,8 +355,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -640,8 +634,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -735,8 +728,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -827,8 +819,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -918,8 +909,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1011,8 +1001,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1107,8 +1096,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1203,8 +1191,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1301,8 +1288,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1399,8 +1385,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1506,8 +1491,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collection.go index dd64f9ebb475..0cbc54d14da9 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collection.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartition.go index 9fca5560643c..019c1c988709 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartition.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartitionregion.go index 8381cb8cde0a..deb18d26e3ce 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartitionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionregion.go index f3acff1933ba..c2e2f1c7fee5 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/database.go index 282ce4dd4339..51789e8d65f7 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/database.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccountregion.go index ba406e6ee580..22c55b0037b7 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccountregion.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccounts.go index 0c81f801f920..7899ef539a76 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/gremlinresources.go index fa52b8da5186..2c15eb9e575b 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/gremlinresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -365,8 +362,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -461,8 +457,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -554,8 +549,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -647,8 +641,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -742,8 +735,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -834,8 +826,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -925,8 +916,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1017,8 +1007,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1113,8 +1102,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1209,8 +1197,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1306,8 +1293,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1404,8 +1390,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1510,8 +1495,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/mongodbresources.go index 3244047bedea..0e8f7526248e 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/mongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -160,8 +159,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -264,8 +262,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -359,8 +356,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -549,8 +544,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -643,8 +637,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -736,8 +729,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -828,8 +820,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -919,8 +910,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1012,8 +1002,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1110,8 +1099,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1206,8 +1194,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1302,8 +1289,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1400,8 +1386,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1507,8 +1492,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/notebookworkspaces.go index 8b2411967a5b..ff07c4375909 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeid.go index 91c70bf809ff..b285d4d789ae 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeid.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeidregion.go index 9ae3728e3071..1bc4cee4d148 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeidregion.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentile.go index 44e839c7e25d..5436c4628506 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentile.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentilesourcetarget.go index 18dbc37bc3be..235b709bb7bc 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentilesourcetarget.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentiletarget.go index 8d2bd5b1ac65..6981868ed023 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentiletarget.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privateendpointconnections.go index a084a08ec5ab..08c31e3d293c 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privatelinkresources.go index 42aee63e6a66..9f401fe21d4d 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/sqlresources.go index 190392816f4d..3d73b69e3a60 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/sqlresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -166,8 +165,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -272,8 +270,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -380,8 +377,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -489,8 +485,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -595,8 +590,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +684,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -786,8 +779,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -884,8 +876,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -982,8 +973,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1079,8 +1069,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1174,8 +1163,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1267,8 +1255,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1360,8 +1347,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1454,8 +1440,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1550,8 +1535,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1646,8 +1630,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1740,8 +1723,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1831,8 +1813,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1923,8 +1904,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2017,8 +1997,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2111,8 +2090,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2205,8 +2183,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2302,8 +2279,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2398,8 +2374,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2493,8 +2468,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2590,8 +2564,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2696,8 +2669,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/tableresources.go index 6202cb007db3..3d0e11d188a8 100644 --- a/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/tableresources.go +++ b/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -156,8 +155,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -250,8 +248,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -343,8 +340,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -434,8 +430,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -525,8 +520,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -620,8 +614,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -716,8 +709,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/_meta.json index bb8404bb6e88..e07fe663aa5c 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2020-04", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/cassandraresources.go index 2b13b57d98e5..e4af75a21e95 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/cassandraresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -263,8 +261,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -358,8 +355,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -640,8 +634,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -735,8 +728,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -827,8 +819,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -918,8 +909,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1011,8 +1001,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1107,8 +1096,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1203,8 +1191,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1301,8 +1288,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1399,8 +1385,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1506,8 +1491,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collection.go index 01c17338d975..13185cd08a81 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collection.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartition.go index f06c02d6bedb..e080f8a02ca6 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartition.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartitionregion.go index 77834820062a..bcdfea41fc8d 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartitionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionregion.go index ab5bcee0f829..37b1f67d0496 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/database.go index f5fe2dd03b1a..16f6b5ae1e14 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/database.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccountregion.go index 0daa8eda77e0..1a1a55773f98 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccountregion.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccounts.go index 4fe81e8dac36..e58362c7de56 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/gremlinresources.go index 939d420b7457..2c16932e54d2 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/gremlinresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -365,8 +362,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -461,8 +457,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -554,8 +549,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -647,8 +641,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -742,8 +735,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -834,8 +826,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -925,8 +916,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1017,8 +1007,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1113,8 +1102,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1209,8 +1197,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1306,8 +1293,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1404,8 +1390,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1510,8 +1495,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/mongodbresources.go index 352ef4445ffa..008a7e1953d9 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/mongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -160,8 +159,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -264,8 +262,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -359,8 +356,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -549,8 +544,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -643,8 +637,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -736,8 +729,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -828,8 +820,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -919,8 +910,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1012,8 +1002,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1110,8 +1099,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1206,8 +1194,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1302,8 +1289,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1400,8 +1386,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1507,8 +1492,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/notebookworkspaces.go index 8884a6088998..7c9b0ffc86e1 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeid.go index d69e30957919..500054903498 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeid.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeidregion.go index 024d58c14d99..33fe5c551cec 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeidregion.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentile.go index c56f691496ed..fb8698e4bbe3 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentile.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentilesourcetarget.go index 6315f13696f2..feefa10a1548 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentilesourcetarget.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentiletarget.go index d0a139aa785a..02c537a94b05 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentiletarget.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privateendpointconnections.go index a084a08ec5ab..08c31e3d293c 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privatelinkresources.go index 42aee63e6a66..9f401fe21d4d 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/sqlresources.go index 81de3f75ca05..b9827b6ea1f0 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/sqlresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -166,8 +165,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -272,8 +270,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -380,8 +377,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -489,8 +485,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -595,8 +590,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +684,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -786,8 +779,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -884,8 +876,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -982,8 +973,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1079,8 +1069,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1174,8 +1163,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1267,8 +1255,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1360,8 +1347,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1454,8 +1440,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1550,8 +1535,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1646,8 +1630,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1740,8 +1723,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1831,8 +1813,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1923,8 +1904,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2017,8 +1997,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2111,8 +2090,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2205,8 +2183,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2302,8 +2279,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2398,8 +2374,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2493,8 +2468,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2590,8 +2564,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2696,8 +2669,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/tableresources.go index 216a9928ceaf..e395b50d783b 100644 --- a/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/tableresources.go +++ b/services/preview/cosmos-db/mgmt/2020-04-01-preview/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -156,8 +155,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -250,8 +248,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -343,8 +340,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -434,8 +430,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -525,8 +520,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -620,8 +614,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -716,8 +709,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..ce102340f96c 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,48 @@ -# Change History +# Unreleased +## Breaking Changes + +### Struct Changes + +#### Removed Structs + +1. DefaultErrorResponse + +#### Removed Struct Fields + +1. RestorableDatabaseAccountGetResult.Identity +1. RestorableDatabaseAccountGetResult.Tags +1. RestorableMongodbCollectionGetResult.Identity +1. RestorableMongodbCollectionGetResult.Location +1. RestorableMongodbCollectionGetResult.Tags +1. RestorableMongodbDatabaseGetResult.Identity +1. RestorableMongodbDatabaseGetResult.Location +1. RestorableMongodbDatabaseGetResult.Tags +1. RestorableSQLContainerGetResult.Identity +1. RestorableSQLContainerGetResult.Location +1. RestorableSQLContainerGetResult.Tags +1. RestorableSQLDatabaseGetResult.Identity +1. RestorableSQLDatabaseGetResult.Location +1. RestorableSQLDatabaseGetResult.Tags + +## Additive Changes + +### New Constants + +1. BackupStorageRedundancy.Geo +1. BackupStorageRedundancy.Local +1. BackupStorageRedundancy.Zone + +### New Funcs + +1. PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy + +### Struct Changes + +#### New Structs + +1. CloudError + +#### New Struct Fields + +1. PeriodicModeProperties.BackupStorageRedundancy diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/_meta.json index e9f2f38579b9..eafe39f2fcea 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "d4bad535d456ee82c7fd17d1ec2b8802a0b83205", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2020-06-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/cassandraresources.go index 1f83a298ae66..d3fd465f1799 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/cassandraresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -263,8 +261,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -358,8 +355,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -640,8 +634,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -735,8 +728,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -827,8 +819,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -918,8 +909,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1012,8 +1002,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1119,8 +1108,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collection.go index d2f9416480a1..250dcc53df9a 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collection.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartition.go index 3beccefb33ce..c9062ab9e8db 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartition.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartitionregion.go index 0f5d149e7d1e..3f61a42c30dc 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartitionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionregion.go index 73d50d888c7c..f3f7fe64a5b3 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/database.go index 3b36684946d3..8e2084501dff 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/database.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccountregion.go index 5a12faf42c68..078822d1c33c 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccountregion.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccounts.go index 06efea8783f1..f20d4ce37eac 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -230,8 +229,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -325,8 +323,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -421,8 +418,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -511,8 +507,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -675,8 +670,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -762,8 +756,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -852,8 +845,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -942,8 +934,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1035,8 +1026,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1126,8 +1116,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1218,8 +1207,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1312,8 +1300,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1409,8 +1396,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1506,8 +1492,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1601,8 +1586,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go index 7c7c76f03368..77a2837e0b37 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go @@ -29,6 +29,23 @@ func PossibleAPITypeValues() []APIType { return []APIType{Cassandra, Gremlin, GremlinV2, MongoDB, SQL, Table} } +// BackupStorageRedundancy enumerates the values for backup storage redundancy. +type BackupStorageRedundancy string + +const ( + // Geo ... + Geo BackupStorageRedundancy = "Geo" + // Local ... + Local BackupStorageRedundancy = "Local" + // Zone ... + Zone BackupStorageRedundancy = "Zone" +) + +// PossibleBackupStorageRedundancyValues returns an array of possible values for the BackupStorageRedundancy const type. +func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { + return []BackupStorageRedundancy{Geo, Local, Zone} +} + // CompositePathSortOrder enumerates the values for composite path sort order. type CompositePathSortOrder string diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/gremlinresources.go index bf11fa669847..4b0bf9cb5cd2 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/gremlinresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -365,8 +362,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -461,8 +457,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -554,8 +549,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -647,8 +641,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -742,8 +735,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -834,8 +826,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -925,8 +916,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1019,8 +1009,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1125,8 +1114,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go index 1bd116467bd4..830e9f4080fb 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go @@ -1074,6 +1074,11 @@ type CassandraTableResource struct { AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` } +// CloudError an error response from the service. +type CloudError struct { + Error *ErrorResponse `json:"error,omitempty"` +} + // ClusterKey cosmos DB Cassandra table cluster key type ClusterKey struct { // Name - Name of the Cosmos DB Cassandra table cluster key @@ -2855,11 +2860,6 @@ type DatabaseRestoreResource struct { CollectionNames *[]string `json:"collectionNames,omitempty"` } -// DefaultErrorResponse an error response from the service. -type DefaultErrorResponse struct { - Error *ErrorResponse `json:"error,omitempty"` -} - // DefaultRequestDatabaseAccountCreateUpdateProperties properties for non-restore Azure Cosmos DB database // account requests. type DefaultRequestDatabaseAccountCreateUpdateProperties struct { @@ -5888,6 +5888,8 @@ type PeriodicModeProperties struct { BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"` // BackupRetentionIntervalInHours - An integer representing the time (in hours) that each backup is retained BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"` + // BackupStorageRedundancy - Enum to indicate type of backup residency. Possible values include: 'Geo', 'Local', 'Zone' + BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` } // Permission the set of data plane operations permitted through this Role Definition. @@ -6245,9 +6247,7 @@ type RestorableDatabaseAccountGetResult struct { // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` } // MarshalJSON is the custom marshaler for RestorableDatabaseAccountGetResult. @@ -6259,12 +6259,6 @@ func (rdagr RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) { if rdagr.Location != nil { objectMap["location"] = rdagr.Location } - if rdagr.Tags != nil { - objectMap["tags"] = rdagr.Tags - } - if rdagr.Identity != nil { - objectMap["identity"] = rdagr.Identity - } return json.Marshal(objectMap) } @@ -6322,24 +6316,6 @@ func (rdagr *RestorableDatabaseAccountGetResult) UnmarshalJSON(body []byte) erro } rdagr.Location = &location } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rdagr.Tags = tags - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rdagr.Identity = &identity - } } } @@ -6407,20 +6383,16 @@ func (rlr RestorableLocationResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RestorableMongodbCollectionGetResult an Azure Cosmos DB restorable MongoDB collection +// RestorableMongodbCollectionGetResult an Azure Cosmos DB MongoDB collection event type RestorableMongodbCollectionGetResult struct { - // RestorableMongodbCollectionProperties - The properties of a restorable MongoDB collection. + // RestorableMongodbCollectionProperties - The properties of a MongoDB collection event. *RestorableMongodbCollectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The unique resource identifier of the ARM resource. + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the ARM resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for RestorableMongodbCollectionGetResult. @@ -6429,15 +6401,6 @@ func (rmcgr RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) if rmcgr.RestorableMongodbCollectionProperties != nil { objectMap["properties"] = rmcgr.RestorableMongodbCollectionProperties } - if rmcgr.Location != nil { - objectMap["location"] = rmcgr.Location - } - if rmcgr.Tags != nil { - objectMap["tags"] = rmcgr.Tags - } - if rmcgr.Identity != nil { - objectMap["identity"] = rmcgr.Identity - } return json.Marshal(objectMap) } @@ -6486,55 +6449,30 @@ func (rmcgr *RestorableMongodbCollectionGetResult) UnmarshalJSON(body []byte) er } rmcgr.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rmcgr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rmcgr.Tags = tags - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rmcgr.Identity = &identity - } } } return nil } -// RestorableMongodbCollectionProperties the properties of an Azure Cosmos DB restorable MongoDB collection +// RestorableMongodbCollectionProperties the properties of an Azure Cosmos DB MongoDB collection event type RestorableMongodbCollectionProperties struct { + // Resource - The resource of an Azure Cosmos DB MongoDB collection event Resource *RestorableMongodbCollectionPropertiesResource `json:"resource,omitempty"` } -// RestorableMongodbCollectionPropertiesResource ... +// RestorableMongodbCollectionPropertiesResource the resource of an Azure Cosmos DB MongoDB collection +// event type RestorableMongodbCollectionPropertiesResource struct { // Rid - READ-ONLY; A system generated property. A unique identifier. Rid *string `json:"_rid,omitempty"` // OperationType - READ-ONLY; The operation type of this collection event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' OperationType OperationType `json:"operationType,omitempty"` - // EventTimestamp - READ-ONLY; The timestamp of this collection event. + // EventTimestamp - READ-ONLY; The time when this collection event happened. EventTimestamp *string `json:"eventTimestamp,omitempty"` - // OwnerID - READ-ONLY; The name of this restorable MongoDB collection. + // OwnerID - READ-ONLY; The name of this MongoDB collection. OwnerID *string `json:"ownerId,omitempty"` - // OwnerResourceID - READ-ONLY; The resource Id of this restorable MongoDB collection. + // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB collection. OwnerResourceID *string `json:"ownerResourceId,omitempty"` } @@ -6544,11 +6482,11 @@ func (rmcp RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, return json.Marshal(objectMap) } -// RestorableMongodbCollectionsListResult the List operation response, that contains the restorable MongoDB -// collections and their properties. +// RestorableMongodbCollectionsListResult the List operation response, that contains the MongoDB collection +// events and their properties. type RestorableMongodbCollectionsListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of restorable MongoDB collections and their properties. + // Value - READ-ONLY; List of MongoDB collection events and their properties. Value *[]RestorableMongodbCollectionGetResult `json:"value,omitempty"` } @@ -6558,20 +6496,16 @@ func (rmclr RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error return json.Marshal(objectMap) } -// RestorableMongodbDatabaseGetResult an Azure Cosmos DB restorable MongoDB database +// RestorableMongodbDatabaseGetResult an Azure Cosmos DB MongoDB database event type RestorableMongodbDatabaseGetResult struct { - // RestorableMongodbDatabaseProperties - The properties of a restorable MongoDB database. + // RestorableMongodbDatabaseProperties - The properties of a MongoDB database event. *RestorableMongodbDatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The unique resource identifier of the ARM resource. + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the ARM resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for RestorableMongodbDatabaseGetResult. @@ -6580,15 +6514,6 @@ func (rmdgr RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { if rmdgr.RestorableMongodbDatabaseProperties != nil { objectMap["properties"] = rmdgr.RestorableMongodbDatabaseProperties } - if rmdgr.Location != nil { - objectMap["location"] = rmdgr.Location - } - if rmdgr.Tags != nil { - objectMap["tags"] = rmdgr.Tags - } - if rmdgr.Identity != nil { - objectMap["identity"] = rmdgr.Identity - } return json.Marshal(objectMap) } @@ -6637,55 +6562,29 @@ func (rmdgr *RestorableMongodbDatabaseGetResult) UnmarshalJSON(body []byte) erro } rmdgr.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rmdgr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rmdgr.Tags = tags - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rmdgr.Identity = &identity - } } } return nil } -// RestorableMongodbDatabaseProperties the properties of an Azure Cosmos DB restorable MongoDB database +// RestorableMongodbDatabaseProperties the properties of an Azure Cosmos DB MongoDB database event type RestorableMongodbDatabaseProperties struct { + // Resource - The resource of an Azure Cosmos DB MongoDB database event Resource *RestorableMongodbDatabasePropertiesResource `json:"resource,omitempty"` } -// RestorableMongodbDatabasePropertiesResource ... +// RestorableMongodbDatabasePropertiesResource the resource of an Azure Cosmos DB MongoDB database event type RestorableMongodbDatabasePropertiesResource struct { // Rid - READ-ONLY; A system generated property. A unique identifier. Rid *string `json:"_rid,omitempty"` // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' OperationType OperationType `json:"operationType,omitempty"` - // EventTimestamp - READ-ONLY; The timestamp of this database event. + // EventTimestamp - READ-ONLY; The time when this database event happened. EventTimestamp *string `json:"eventTimestamp,omitempty"` - // OwnerID - READ-ONLY; The name of this restorable MongoDB database. + // OwnerID - READ-ONLY; The name of this MongoDB database. OwnerID *string `json:"ownerId,omitempty"` - // OwnerResourceID - READ-ONLY; The resource Id of this restorable MongoDB database. + // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB database. OwnerResourceID *string `json:"ownerResourceId,omitempty"` } @@ -6695,11 +6594,11 @@ func (rmdp RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, e return json.Marshal(objectMap) } -// RestorableMongodbDatabasesListResult the List operation response, that contains the restorable MongoDB -// databases and their properties. +// RestorableMongodbDatabasesListResult the List operation response, that contains the MongoDB database +// events and their properties. type RestorableMongodbDatabasesListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of restorable MongoDB databases and their properties. + // Value - READ-ONLY; List of MongoDB database events and their properties. Value *[]RestorableMongodbDatabaseGetResult `json:"value,omitempty"` } @@ -6723,20 +6622,16 @@ func (rmrlr RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// RestorableSQLContainerGetResult an Azure Cosmos DB restorable SQL container +// RestorableSQLContainerGetResult an Azure Cosmos DB SQL container event type RestorableSQLContainerGetResult struct { - // RestorableSQLContainerProperties - The properties of a restorable SQL container. + // RestorableSQLContainerProperties - The properties of a SQL container event. *RestorableSQLContainerProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The unique resource identifier of the ARM resource. + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the ARM resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for RestorableSQLContainerGetResult. @@ -6745,15 +6640,6 @@ func (rscgr RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { if rscgr.RestorableSQLContainerProperties != nil { objectMap["properties"] = rscgr.RestorableSQLContainerProperties } - if rscgr.Location != nil { - objectMap["location"] = rscgr.Location - } - if rscgr.Tags != nil { - objectMap["tags"] = rscgr.Tags - } - if rscgr.Identity != nil { - objectMap["identity"] = rscgr.Identity - } return json.Marshal(objectMap) } @@ -6802,57 +6688,32 @@ func (rscgr *RestorableSQLContainerGetResult) UnmarshalJSON(body []byte) error { } rscgr.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rscgr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rscgr.Tags = tags - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rscgr.Identity = &identity - } } } return nil } -// RestorableSQLContainerProperties the properties of an Azure Cosmos DB restorable SQL container +// RestorableSQLContainerProperties the properties of an Azure Cosmos DB SQL container event type RestorableSQLContainerProperties struct { + // Resource - The resource of an Azure Cosmos DB SQL container event Resource *RestorableSQLContainerPropertiesResource `json:"resource,omitempty"` } -// RestorableSQLContainerPropertiesResource ... +// RestorableSQLContainerPropertiesResource the resource of an Azure Cosmos DB SQL container event type RestorableSQLContainerPropertiesResource struct { // Rid - READ-ONLY; A system generated property. A unique identifier. Rid *string `json:"_rid,omitempty"` // OperationType - READ-ONLY; The operation type of this container event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' OperationType OperationType `json:"operationType,omitempty"` - // EventTimestamp - READ-ONLY; The timestamp of this container event. + // EventTimestamp - READ-ONLY; The when this container event happened. EventTimestamp *string `json:"eventTimestamp,omitempty"` - // OwnerID - READ-ONLY; The name of this restorable SQL container. + // OwnerID - READ-ONLY; The name of this SQL container. OwnerID *string `json:"ownerId,omitempty"` - // OwnerResourceID - READ-ONLY; The resource Id of this restorable SQL container. - OwnerResourceID *string `json:"ownerResourceId,omitempty"` - Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of this SQL container. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` + // Container - Cosmos DB SQL container resource object + Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"` } // MarshalJSON is the custom marshaler for RestorableSQLContainerPropertiesResource. @@ -6864,7 +6725,7 @@ func (rscp RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, erro return json.Marshal(objectMap) } -// RestorableSQLContainerPropertiesResourceContainer ... +// RestorableSQLContainerPropertiesResourceContainer cosmos DB SQL container resource object type RestorableSQLContainerPropertiesResourceContainer struct { // ID - Name of the Cosmos DB SQL container ID *string `json:"id,omitempty"` @@ -6912,11 +6773,11 @@ func (rscp RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]b return json.Marshal(objectMap) } -// RestorableSQLContainersListResult the List operation response, that contains the restorable SQL -// containers and their properties. +// RestorableSQLContainersListResult the List operation response, that contains the SQL container events +// and their properties. type RestorableSQLContainersListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of restorable SQL containers and their properties. + // Value - READ-ONLY; List of SQL container events and their properties. Value *[]RestorableSQLContainerGetResult `json:"value,omitempty"` } @@ -6926,20 +6787,16 @@ func (rsclr RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RestorableSQLDatabaseGetResult an Azure Cosmos DB restorable SQL database +// RestorableSQLDatabaseGetResult an Azure Cosmos DB SQL database event type RestorableSQLDatabaseGetResult struct { - // RestorableSQLDatabaseProperties - The properties of a restorable SQL database. + // RestorableSQLDatabaseProperties - The properties of a SQL database event. *RestorableSQLDatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The unique resource identifier of the ARM resource. + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the ARM resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of Azure resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags map[string]*string `json:"tags"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for RestorableSQLDatabaseGetResult. @@ -6948,15 +6805,6 @@ func (rsdgr RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { if rsdgr.RestorableSQLDatabaseProperties != nil { objectMap["properties"] = rsdgr.RestorableSQLDatabaseProperties } - if rsdgr.Location != nil { - objectMap["location"] = rsdgr.Location - } - if rsdgr.Tags != nil { - objectMap["tags"] = rsdgr.Tags - } - if rsdgr.Identity != nil { - objectMap["identity"] = rsdgr.Identity - } return json.Marshal(objectMap) } @@ -7005,57 +6853,32 @@ func (rsdgr *RestorableSQLDatabaseGetResult) UnmarshalJSON(body []byte) error { } rsdgr.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rsdgr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rsdgr.Tags = tags - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - rsdgr.Identity = &identity - } } } return nil } -// RestorableSQLDatabaseProperties the properties of an Azure Cosmos DB restorable SQL database +// RestorableSQLDatabaseProperties the properties of an Azure Cosmos DB SQL database event type RestorableSQLDatabaseProperties struct { + // Resource - The resource of an Azure Cosmos DB SQL database event Resource *RestorableSQLDatabasePropertiesResource `json:"resource,omitempty"` } -// RestorableSQLDatabasePropertiesResource ... +// RestorableSQLDatabasePropertiesResource the resource of an Azure Cosmos DB SQL database event type RestorableSQLDatabasePropertiesResource struct { // Rid - READ-ONLY; A system generated property. A unique identifier. Rid *string `json:"_rid,omitempty"` // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' OperationType OperationType `json:"operationType,omitempty"` - // EventTimestamp - READ-ONLY; The timestamp of this database event. + // EventTimestamp - READ-ONLY; The time when this database event happened. EventTimestamp *string `json:"eventTimestamp,omitempty"` - // OwnerID - READ-ONLY; The name of this restorable SQL database. + // OwnerID - READ-ONLY; The name of the SQL database. OwnerID *string `json:"ownerId,omitempty"` - // OwnerResourceID - READ-ONLY; The resource Id of this restorable SQL database. - OwnerResourceID *string `json:"ownerResourceId,omitempty"` - Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of the SQL database. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` + // Database - Cosmos DB SQL database resource object + Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"` } // MarshalJSON is the custom marshaler for RestorableSQLDatabasePropertiesResource. @@ -7067,7 +6890,7 @@ func (rsdp RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error return json.Marshal(objectMap) } -// RestorableSQLDatabasePropertiesResourceDatabase ... +// RestorableSQLDatabasePropertiesResourceDatabase cosmos DB SQL database resource object type RestorableSQLDatabasePropertiesResourceDatabase struct { // ID - Name of the Cosmos DB SQL database ID *string `json:"id,omitempty"` @@ -7094,11 +6917,11 @@ func (rsdp RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byt return json.Marshal(objectMap) } -// RestorableSQLDatabasesListResult the List operation response, that contains the restorable SQL databases -// and their properties. +// RestorableSQLDatabasesListResult the List operation response, that contains the SQL database events and +// their properties. type RestorableSQLDatabasesListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of restorable SQL databases and their properties. + // Value - READ-ONLY; List of SQL database events and their properties. Value *[]RestorableSQLDatabaseGetResult `json:"value,omitempty"` } @@ -9905,7 +9728,7 @@ type SystemData struct { LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The type of identity that last modified the resource. + // LastModifiedAt - The timestamp of resource last modification (UTC) LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/mongodbresources.go index ef2421a5331a..d91ff8ed2dd5 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/mongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -160,8 +159,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -264,8 +262,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -359,8 +356,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -454,8 +450,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -549,8 +544,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -643,8 +637,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -736,8 +729,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -828,8 +820,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -919,8 +910,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1013,8 +1003,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1120,8 +1109,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/notebookworkspaces.go index cfa41642098e..886f96467ddf 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeid.go index f82c4be0cbb4..585b617ecc7f 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeid.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeidregion.go index 38b33e59e1f0..956bbeaec7b4 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeidregion.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentile.go index dcb239cb849c..92df78063fd5 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentile.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentilesourcetarget.go index a366c6387a6b..d01c58e5e633 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentilesourcetarget.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentiletarget.go index 9e26ed0ab726..19eee44a6921 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentiletarget.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privateendpointconnections.go index 61e8111492bc..867fcffdfd7a 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privatelinkresources.go index f58cda077eb4..60ce7562627f 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorabledatabaseaccounts.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorabledatabaseaccounts.go index b17a884f51dc..76e50149d066 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorabledatabaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorabledatabaseaccounts.go @@ -32,7 +32,8 @@ func NewRestorableDatabaseAccountsClientWithBaseURI(baseURI string, subscription return RestorableDatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// GetByLocation retrieves the properties of an existing Azure Cosmos DB restorable database account. +// GetByLocation retrieves the properties of an existing Azure Cosmos DB restorable database account. This call +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. @@ -114,7 +115,8 @@ func (client RestorableDatabaseAccountsClient) GetByLocationResponder(resp *http return } -// List lists all the restorable Azure Cosmos DB database accounts available under the subscription. +// List lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. func (client RestorableDatabaseAccountsClient) List(ctx context.Context) (result RestorableDatabaseAccountsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDatabaseAccountsClient.List") @@ -192,7 +194,7 @@ func (client RestorableDatabaseAccountsClient) ListResponder(resp *http.Response } // ListByLocation lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a -// region. +// region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. func (client RestorableDatabaseAccountsClient) ListByLocation(ctx context.Context, location string) (result RestorableDatabaseAccountsListResult, err error) { diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbcollections.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbcollections.go index 20ebf476ee8d..45880feb9bab 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbcollections.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbcollections.go @@ -33,11 +33,13 @@ func NewRestorableMongodbCollectionsClientWithBaseURI(baseURI string, subscripti return RestorableMongodbCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB MongoDB collection available for a specific database. +// List show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific +// database. This helps in scenario where container was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. -// restorableMongodbDatabaseRid - the resource id of the restorable Mongo database. +// restorableMongodbDatabaseRid - the resource ID of the MongoDB database. func (client RestorableMongodbCollectionsClient) List(ctx context.Context, location string, instanceID string, restorableMongodbDatabaseRid string) (result RestorableMongodbCollectionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RestorableMongodbCollectionsClient.List") diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbdatabases.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbdatabases.go index b84a7ab5e380..17d9b23bcd90 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbdatabases.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbdatabases.go @@ -32,7 +32,9 @@ func NewRestorableMongodbDatabasesClientWithBaseURI(baseURI string, subscription return RestorableMongodbDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB MongoDB databases available under the restorable account. +// List show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable +// account. This helps in scenario where database was accidentally deleted to get the deletion time. This API +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbresources.go index 8ad4b9cd4146..6e3729b55fa4 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablemongodbresources.go @@ -32,8 +32,9 @@ func NewRestorableMongodbResourcesClientWithBaseURI(baseURI string, subscription return RestorableMongodbResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB MongoDB resources available for a specific database account at a given -// time and location. +// List return a list of database and collection combo that exist on the account at the given timestamp and location. +// This helps in scenarios to validate what resources exist at given timestamp and location. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlcontainers.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlcontainers.go index 6d2a70e25d4a..a00b30ec9897 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlcontainers.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlcontainers.go @@ -32,11 +32,13 @@ func NewRestorableSQLContainersClientWithBaseURI(baseURI string, subscriptionID return RestorableSQLContainersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB SQL containers available for a specific database. +// List show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. +// This helps in scenario where container was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. -// restorableSQLDatabaseRid - the resource id of the restorable SQL database. +// restorableSQLDatabaseRid - the resource ID of the SQL database. func (client RestorableSQLContainersClient) List(ctx context.Context, location string, instanceID string, restorableSQLDatabaseRid string) (result RestorableSQLContainersListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RestorableSQLContainersClient.List") diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqldatabases.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqldatabases.go index e0876b1df311..18af47dd9694 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqldatabases.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqldatabases.go @@ -32,7 +32,9 @@ func NewRestorableSQLDatabasesClientWithBaseURI(baseURI string, subscriptionID s return RestorableSQLDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB SQL databases available under the restorable account. +// List show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable +// account. This helps in scenario where database was accidentally deleted to get the deletion time. This API +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlresources.go index 6de7eeadea87..f7a05617761f 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/restorablesqlresources.go @@ -32,8 +32,9 @@ func NewRestorableSQLResourcesClientWithBaseURI(baseURI string, subscriptionID s return RestorableSQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all the restorable Azure Cosmos DB SQL resources available for a specific database account at a given -// time and location. +// List return a list of database and container combo that exist on the account at the given timestamp and location. +// This helps in scenarios to validate what resources exist at given timestamp and location. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. // Parameters: // location - cosmos DB region, with spaces between words and each word capitalized. // instanceID - the instanceId GUID of a restorable database account. diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/sqlresources.go index 67e9a987efad..bacd49926259 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/sqlresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -166,8 +165,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleAssignment(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -368,8 +365,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleDefinition(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -468,8 +464,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -576,8 +571,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -685,8 +679,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -791,8 +784,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -886,8 +878,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -980,8 +971,7 @@ func (client SQLResourcesClient) DeleteSQLRoleAssignment(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1074,8 +1064,7 @@ func (client SQLResourcesClient) DeleteSQLRoleDefinition(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1170,8 +1159,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1268,8 +1256,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1366,8 +1353,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1463,8 +1449,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1558,8 +1543,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1651,8 +1635,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1744,8 +1727,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1836,8 +1818,7 @@ func (client SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleA Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1928,8 +1909,7 @@ func (client SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleD Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2022,8 +2002,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2118,8 +2097,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2214,8 +2192,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2308,8 +2285,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2399,8 +2375,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2489,8 +2464,7 @@ func (client SQLResourcesClient) ListSQLRoleAssignments(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2579,8 +2553,7 @@ func (client SQLResourcesClient) ListSQLRoleDefinitions(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2671,8 +2644,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2765,8 +2737,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2859,8 +2830,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2954,8 +2924,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3060,8 +3029,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/tableresources.go index 84f949e83013..5f6ba2368049 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/tableresources.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -156,8 +155,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -250,8 +248,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -343,8 +340,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -434,8 +430,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +521,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/_meta.json index f64ccc22de46..d1add74cc948 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "2601b21eccaab01da2feb65d232ab6c3cb9c1c45", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2020-09", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/cassandraresources.go index 65c09d4d90f2..e5ceb4bac7b3 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/cassandraresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -261,8 +259,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -356,8 +353,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -545,8 +540,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -638,8 +632,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -733,8 +726,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -825,8 +817,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -916,8 +907,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1009,8 +999,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1105,8 +1094,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1201,8 +1189,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1299,8 +1286,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1397,8 +1383,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1504,8 +1489,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collection.go index e7d10f0eae3a..6fbe1bdf2df6 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collection.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartition.go index e32d74d0f543..fd632f9a7e45 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartition.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartitionregion.go index 1c9b5fcf3b99..fa6010ea89d9 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartitionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionregion.go index 6f6853da00f2..799ffdd6b99c 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionregion.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/database.go index 17f6e808d371..56da31414929 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/database.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccountregion.go index d46f959eb57f..6f231bfdcfa9 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccountregion.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccounts.go index 4113fae70737..6d9563d108a6 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -245,8 +244,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -340,8 +338,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -436,8 +433,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -526,8 +522,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -690,8 +685,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -777,8 +771,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -867,8 +860,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -957,8 +949,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1050,8 +1041,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1141,8 +1131,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1233,8 +1222,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1327,8 +1315,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1424,8 +1411,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1521,8 +1507,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1616,8 +1601,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/gremlinresources.go index c06231bdaf60..cf9db05b7e74 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/gremlinresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -363,8 +360,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -459,8 +455,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -552,8 +547,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -645,8 +639,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -740,8 +733,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -832,8 +824,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -923,8 +914,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1015,8 +1005,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1111,8 +1100,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1207,8 +1195,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1304,8 +1291,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1402,8 +1388,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1508,8 +1493,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/mongodbresources.go index f8271f5cee65..8779d7ce7ed2 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/mongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -262,8 +260,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -357,8 +354,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -641,8 +635,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -734,8 +727,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -826,8 +818,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -917,8 +908,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1010,8 +1000,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1108,8 +1097,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1204,8 +1192,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1300,8 +1287,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1398,8 +1384,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1505,8 +1490,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/notebookworkspaces.go index 3949881a1565..7b8581e0063e 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeid.go index 211e79a88622..225c846904f4 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeid.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeidregion.go index 10c4fef010c2..7db503c98ec2 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeidregion.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentile.go index ba7324d1c083..c459cfb43788 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentile.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentilesourcetarget.go index f77efb30ebd3..36651a24e44d 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentilesourcetarget.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentiletarget.go index 55aac5bb131a..64fa0077d67e 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentiletarget.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privateendpointconnections.go index a084a08ec5ab..08c31e3d293c 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privatelinkresources.go index 42aee63e6a66..9f401fe21d4d 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/sqlresources.go index 904f0fdc8a2b..f5c8392560c9 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/sqlresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -165,8 +164,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -270,8 +268,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -377,8 +374,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -485,8 +481,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -590,8 +585,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -685,8 +679,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -781,8 +774,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -879,8 +871,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -977,8 +968,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1074,8 +1064,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1169,8 +1158,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1262,8 +1250,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1355,8 +1342,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1449,8 +1435,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1545,8 +1530,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1641,8 +1625,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1735,8 +1718,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1826,8 +1808,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1918,8 +1899,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2012,8 +1992,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2106,8 +2085,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2200,8 +2178,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2297,8 +2274,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2393,8 +2369,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2488,8 +2463,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2585,8 +2559,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2691,8 +2664,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/tableresources.go index f6cb679a8bbb..15d90721b134 100644 --- a/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/tableresources.go +++ b/services/preview/cosmos-db/mgmt/2020-09-01-preview/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -155,8 +154,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -249,8 +247,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -342,8 +339,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -433,8 +429,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -524,8 +519,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -619,8 +613,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -715,8 +708,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/_meta.json index c0d2f4819d25..1697b66423fc 100644 --- a/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "6e95cd4c6086d61bb3de67cf6e4209a7b84efa23", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-03-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/CHANGELOG.md index 52911e4cc5e4..9eae419012f8 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/CHANGELOG.md +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/CHANGELOG.md @@ -1,2 +1,40 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. ServiceTypeBasicServiceResourceProperties.ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties +1. ServiceTypeBasicServiceResourceProperties.ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties + +### Signature Changes + +#### Funcs + +1. ServiceClient.Create + - Params + - From: context.Context, string, string, string, ServiceResource + - To: context.Context, string, string, string, ServiceResourceCreateUpdateParameters +1. ServiceClient.CreatePreparer + - Params + - From: context.Context, string, string, string, ServiceResource + - To: context.Context, string, string, string, ServiceResourceCreateUpdateParameters + +## Additive Changes + +### New Constants + +1. ServiceTypeBasicServiceResourceProperties.ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer +1. ServiceTypeBasicServiceResourceProperties.ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway + +### New Funcs + +1. *ServiceResourceCreateUpdateParameters.UnmarshalJSON([]byte) error +1. ServiceResourceCreateUpdateParameters.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. ServiceResourceCreateUpdateParameters +1. ServiceResourceCreateUpdateProperties diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/_meta.json index cae84ecb67ae..d11f0450b0b9 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/_meta.json +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "c2ea3a3ccd14293b4bd1d17e684ef9129f0dc604", + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", "tag": "package-2021-04-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraclusters.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraclusters.go index c570b344c958..c80718203f9a 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraclusters.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraclusters.go @@ -54,12 +54,11 @@ func (client CassandraClustersClient) CreateUpdate(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "CreateUpdate", err.Error()) } @@ -149,12 +148,11 @@ func (client CassandraClustersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "Delete", err.Error()) } @@ -241,12 +239,11 @@ func (client CassandraClustersClient) FetchNodeStatus(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "FetchNodeStatus", err.Error()) } @@ -334,12 +331,11 @@ func (client CassandraClustersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "Get", err.Error()) } @@ -425,12 +421,11 @@ func (client CassandraClustersClient) GetBackup(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: backupID, Constraints: []validation.Constraint{{Target: "backupID", Name: validation.MaxLength, Rule: 15, Chain: nil}, {Target: "backupID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -520,12 +515,11 @@ func (client CassandraClustersClient) ListBackupsMethod(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "ListBackupsMethod", err.Error()) } @@ -609,8 +603,7 @@ func (client CassandraClustersClient) ListByResourceGroup(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "ListByResourceGroup", err.Error()) } @@ -772,12 +765,11 @@ func (client CassandraClustersClient) RequestRepair(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Keyspace", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "RequestRepair", err.Error()) @@ -869,12 +861,11 @@ func (client CassandraClustersClient) Update(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraClustersClient", "Update", err.Error()) } diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandradatacenters.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandradatacenters.go index 0caf44c269bd..4febc048c26f 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandradatacenters.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandradatacenters.go @@ -55,16 +55,15 @@ func (client CassandraDataCentersClient) CreateUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: dataCenterName, Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraDataCentersClient", "CreateUpdate", err.Error()) } @@ -156,16 +155,15 @@ func (client CassandraDataCentersClient) Delete(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: dataCenterName, Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraDataCentersClient", "Delete", err.Error()) } @@ -254,16 +252,15 @@ func (client CassandraDataCentersClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: dataCenterName, Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraDataCentersClient", "Get", err.Error()) } @@ -349,12 +346,11 @@ func (client CassandraDataCentersClient) List(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraDataCentersClient", "List", err.Error()) } @@ -441,16 +437,15 @@ func (client CassandraDataCentersClient) Update(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, {TargetValue: dataCenterName, Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*`, Chain: nil}}}}); err != nil { + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.CassandraDataCentersClient", "Update", err.Error()) } diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraresources.go index 15b41f5d59da..d9667d0dc717 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/cassandraresources.go @@ -54,8 +54,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -261,8 +259,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -356,8 +353,7 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -545,8 +540,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -638,8 +632,7 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -733,8 +726,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -825,8 +817,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -916,8 +907,7 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1009,8 +999,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1105,8 +1094,7 @@ func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughpu Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1201,8 +1189,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1299,8 +1286,7 @@ func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1397,8 +1383,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1504,8 +1489,7 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collection.go index 41e150723e23..e5bfbcc3963d 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collection.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collection.go @@ -53,8 +53,7 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -247,8 +245,7 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartition.go index 3bab5009628f..6d9dd4db8d09 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartition.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartition.go @@ -57,8 +57,7 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -154,8 +153,7 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartitionregion.go index 6520cdeef451..71167651982f 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartitionregion.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionpartitionregion.go @@ -59,8 +59,7 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionregion.go index 3ad6ed0d04c7..c6362563e6d5 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionregion.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/collectionregion.go @@ -59,8 +59,7 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/database.go index 437301c58f3a..6c74a915d74e 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/database.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/database.go @@ -52,8 +52,7 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -147,8 +146,7 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccountregion.go index 8056e021ef24..4a0b66087738 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccountregion.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccountregion.go @@ -56,8 +56,7 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccounts.go index 6fbfaa5f63f6..09c3323c0a31 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccounts.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/databaseaccounts.go @@ -135,8 +135,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -230,8 +229,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -325,8 +323,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -421,8 +418,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -511,8 +507,7 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -675,8 +670,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) @@ -762,8 +756,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -852,8 +845,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -942,8 +934,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1035,8 +1026,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1126,8 +1116,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1218,8 +1207,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1312,8 +1300,7 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1409,8 +1396,7 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1506,8 +1492,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1601,8 +1586,7 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/documentdbapi/interfaces.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/documentdbapi/interfaces.go index b230586e96d0..a56783f7e748 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/documentdbapi/interfaces.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/documentdbapi/interfaces.go @@ -368,7 +368,7 @@ var _ PrivateEndpointConnectionsClientAPI = (*documentdb.PrivateEndpointConnecti // ServiceClientAPI contains the set of methods on the ServiceClient type. type ServiceClientAPI interface { - Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters documentdb.ServiceResource) (result documentdb.ServiceCreateFuture, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters documentdb.ServiceResourceCreateUpdateParameters) (result documentdb.ServiceCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result documentdb.ServiceDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result documentdb.ServiceResource, err error) List(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.ServiceResourceListResult, err error) diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/enums.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/enums.go index d0389dbaecce..b58c117148b4 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/enums.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/enums.go @@ -570,17 +570,17 @@ func PossibleServiceTypeValues() []ServiceType { type ServiceTypeBasicServiceResourceProperties string const ( - // ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties ... - ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties ServiceTypeBasicServiceResourceProperties = "DataTransferServiceResourceProperties" + // ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer ... + ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer ServiceTypeBasicServiceResourceProperties = "DataTransfer" // ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties ... ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties ServiceTypeBasicServiceResourceProperties = "ServiceResourceProperties" - // ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties ... - ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties ServiceTypeBasicServiceResourceProperties = "SqlDedicatedGatewayServiceResourceProperties" + // ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway ... + ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway ServiceTypeBasicServiceResourceProperties = "SqlDedicatedGateway" ) // PossibleServiceTypeBasicServiceResourcePropertiesValues returns an array of possible values for the ServiceTypeBasicServiceResourceProperties const type. func PossibleServiceTypeBasicServiceResourcePropertiesValues() []ServiceTypeBasicServiceResourceProperties { - return []ServiceTypeBasicServiceResourceProperties{ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties, ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties, ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties} + return []ServiceTypeBasicServiceResourceProperties{ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer, ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties, ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway} } // SpatialType enumerates the values for spatial type. diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/gremlinresources.go index 7c8013ee2a48..98f0923223fb 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/gremlinresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/gremlinresources.go @@ -54,8 +54,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -158,8 +157,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -363,8 +360,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -459,8 +455,7 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -552,8 +547,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -645,8 +639,7 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -740,8 +733,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -832,8 +824,7 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -923,8 +914,7 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1015,8 +1005,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1111,8 +1100,7 @@ func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1207,8 +1195,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1304,8 +1291,7 @@ func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx c Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1402,8 +1388,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1508,8 +1493,7 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/models.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/models.go index 4e1f78563627..ae28f9dc909e 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/models.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/models.go @@ -3780,13 +3780,13 @@ type DataTransferServiceResourceProperties struct { InstanceCount *int32 `json:"instanceCount,omitempty"` // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' Status ServiceStatus `json:"status,omitempty"` - // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties' + // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway' ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` } // MarshalJSON is the custom marshaler for DataTransferServiceResourceProperties. func (dtsrp DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { - dtsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties + dtsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer objectMap := make(map[string]interface{}) if dtsrp.InstanceSize != "" { objectMap["instanceSize"] = dtsrp.InstanceSize @@ -9037,6 +9037,54 @@ func (sr *ServiceResource) UnmarshalJSON(body []byte) error { return nil } +// ServiceResourceCreateUpdateParameters parameters for Create or Update Request for ServiceResource +type ServiceResourceCreateUpdateParameters struct { + *ServiceResourceCreateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceResourceCreateUpdateParameters. +func (srcup ServiceResourceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srcup.ServiceResourceCreateUpdateProperties != nil { + objectMap["properties"] = srcup.ServiceResourceCreateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceResourceCreateUpdateParameters struct. +func (srcup *ServiceResourceCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceResourceCreateUpdateProperties ServiceResourceCreateUpdateProperties + err = json.Unmarshal(*v, &serviceResourceCreateUpdateProperties) + if err != nil { + return err + } + srcup.ServiceResourceCreateUpdateProperties = &serviceResourceCreateUpdateProperties + } + } + } + + return nil +} + +// ServiceResourceCreateUpdateProperties properties in ServiceResourceCreateUpdateParameters. +type ServiceResourceCreateUpdateProperties struct { + // InstanceSize - Possible values include: 'ServiceSizeCosmosD4s', 'ServiceSizeCosmosD8s', 'ServiceSizeCosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // ServiceType - Possible values include: 'ServiceTypeSQLDedicatedGateway', 'ServiceTypeDataTransfer' + ServiceType ServiceType `json:"serviceType,omitempty"` +} + // ServiceResourceListResult the List operation response, that contains the Service Resource and their // properties. type ServiceResourceListResult struct { @@ -9070,7 +9118,7 @@ type ServiceResourceProperties struct { InstanceCount *int32 `json:"instanceCount,omitempty"` // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' Status ServiceStatus `json:"status,omitempty"` - // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties' + // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway' ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` } @@ -9082,11 +9130,11 @@ func unmarshalBasicServiceResourceProperties(body []byte) (BasicServiceResourceP } switch m["serviceType"] { - case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties): + case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer): var dtsrp DataTransferServiceResourceProperties err := json.Unmarshal(body, &dtsrp) return dtsrp, err - case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties): + case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway): var sdgsrp SQLDedicatedGatewayServiceResourceProperties err := json.Unmarshal(body, &sdgsrp) return sdgsrp, err @@ -9899,13 +9947,13 @@ type SQLDedicatedGatewayServiceResourceProperties struct { InstanceCount *int32 `json:"instanceCount,omitempty"` // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' Status ServiceStatus `json:"status,omitempty"` - // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties' + // ServiceType - Possible values include: 'ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransfer', 'ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway' ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` } // MarshalJSON is the custom marshaler for SQLDedicatedGatewayServiceResourceProperties. func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) MarshalJSON() ([]byte, error) { - sdgsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties + sdgsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGateway objectMap := make(map[string]interface{}) if sdgsrp.SQLDedicatedGatewayEndpoint != nil { objectMap["sqlDedicatedGatewayEndpoint"] = sdgsrp.SQLDedicatedGatewayEndpoint diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/mongodbresources.go index fd148530fcf6..bd21a53ba394 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/mongodbresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/mongodbresources.go @@ -55,8 +55,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -159,8 +158,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -262,8 +260,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -357,8 +354,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -452,8 +448,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -547,8 +542,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -641,8 +635,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -734,8 +727,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -826,8 +818,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -917,8 +908,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1010,8 +1000,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx con Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1108,8 +1097,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1204,8 +1192,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1300,8 +1287,7 @@ func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ct Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1398,8 +1384,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1505,8 +1490,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/notebookworkspaces.go index c6917f604a40..59ae9df686fa 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/notebookworkspaces.go @@ -53,8 +53,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -149,8 +148,7 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -242,8 +240,7 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -333,8 +330,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -423,8 +419,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -514,8 +509,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -607,8 +601,7 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeid.go index 05d11d5fc839..a8a7fb2f7351 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeid.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeid.go @@ -58,8 +58,7 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeidregion.go index 43342782b84a..76bf43694903 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeidregion.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/partitionkeyrangeidregion.go @@ -59,8 +59,7 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentile.go index 7f6f42c16397..671923ea373a 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentile.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentile.go @@ -55,8 +55,7 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentilesourcetarget.go index 4c37074c728f..7a379aa2e344 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentilesourcetarget.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentilesourcetarget.go @@ -60,8 +60,7 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentiletarget.go index 4fdd88223594..21bc1ba111cc 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentiletarget.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/percentiletarget.go @@ -58,8 +58,7 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privateendpointconnections.go index 52b3c86670c8..364a3070e917 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privateendpointconnections.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -244,8 +242,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -335,8 +332,7 @@ func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privatelinkresources.go index e5cfe0f258ec..851a8dc57070 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -144,8 +143,7 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/service.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/service.go index 77a22356fef2..70b237ed92ed 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/service.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/service.go @@ -37,7 +37,7 @@ func NewServiceClientWithBaseURI(baseURI string, subscriptionID string) ServiceC // accountName - cosmos DB database account name. // serviceName - cosmos DB service name. // createUpdateParameters - the Service resource parameters. -func (client ServiceClient) Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResource) (result ServiceCreateFuture, err error) { +func (client ServiceClient) Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters) (result ServiceCreateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Create") defer func() { @@ -53,15 +53,19 @@ func (client ServiceClient) Create(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + {Target: "serviceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: createUpdateParameters, + Constraints: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties.InstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties.InstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + }}}}}); err != nil { return result, validation.NewError("documentdb.ServiceClient", "Create", err.Error()) } @@ -81,7 +85,7 @@ func (client ServiceClient) Create(ctx context.Context, resourceGroupName string } // CreatePreparer prepares the Create request. -func (client ServiceClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResource) (*http.Request, error) { +func (client ServiceClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -153,8 +157,7 @@ func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -250,8 +253,7 @@ func (client ServiceClient) Get(ctx context.Context, resourceGroupName string, a Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -344,8 +346,7 @@ func (client ServiceClient) List(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/sqlresources.go index 0a358c1c8c07..d290a48dcecf 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/sqlresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/sqlresources.go @@ -54,8 +54,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -165,8 +164,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -268,8 +266,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleAssignment(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -366,8 +363,7 @@ func (client SQLResourcesClient) CreateUpdateSQLRoleDefinition(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -466,8 +462,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -573,8 +568,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -681,8 +675,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -786,8 +779,7 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -881,8 +873,7 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -975,8 +966,7 @@ func (client SQLResourcesClient) DeleteSQLRoleAssignment(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1069,8 +1059,7 @@ func (client SQLResourcesClient) DeleteSQLRoleDefinition(ctx context.Context, ro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1165,8 +1154,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1263,8 +1251,7 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1361,8 +1348,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1458,8 +1444,7 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1553,8 +1538,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1646,8 +1630,7 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1739,8 +1722,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1831,8 +1813,7 @@ func (client SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleA Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -1923,8 +1904,7 @@ func (client SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleD Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2017,8 +1997,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2113,8 +2092,7 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2209,8 +2187,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2303,8 +2280,7 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2394,8 +2370,7 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2484,8 +2459,7 @@ func (client SQLResourcesClient) ListSQLRoleAssignments(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2574,8 +2548,7 @@ func (client SQLResourcesClient) ListSQLRoleDefinitions(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2666,8 +2639,7 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2760,8 +2732,7 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2854,8 +2825,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -2948,8 +2918,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3045,8 +3014,7 @@ func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3141,8 +3109,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3236,8 +3203,7 @@ func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3333,8 +3299,7 @@ func (client SQLResourcesClient) RetrieveContinuousBackupInformation(ctx context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3433,8 +3398,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -3539,8 +3503,7 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/tableresources.go index 0cf7052cfe58..7322429089b5 100644 --- a/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/tableresources.go +++ b/services/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb/tableresources.go @@ -53,8 +53,7 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -155,8 +154,7 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -249,8 +247,7 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -342,8 +339,7 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -433,8 +429,7 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -524,8 +519,7 @@ func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -619,8 +613,7 @@ func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Co Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -715,8 +708,7 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/CHANGELOG.md b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/_meta.json b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/_meta.json new file mode 100644 index 000000000000..8ba85a9cbb24 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "5405df1424664d1c6ef9cdcda426eb85e59a02cc", + "readme": "/_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", + "tag": "package-2021-07-preview", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-07-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraclusters.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraclusters.go new file mode 100644 index 000000000000..8ded6fdea81f --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraclusters.go @@ -0,0 +1,936 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CassandraClustersClient is the client for the CassandraClusters methods of the Documentdb service. +type CassandraClustersClient struct { + BaseClient +} + +// NewCassandraClustersClient creates an instance of the CassandraClustersClient client. +func NewCassandraClustersClient(subscriptionID string) CassandraClustersClient { + return NewCassandraClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCassandraClustersClientWithBaseURI creates an instance of the CassandraClustersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCassandraClustersClientWithBaseURI(baseURI string, subscriptionID string) CassandraClustersClient { + return CassandraClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdate create or update a managed Cassandra cluster. When updating, you must specify all writable properties. +// To update only some properties, use PATCH. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// body - the properties specifying the desired state of the managed Cassandra cluster. +func (client CassandraClustersClient) CreateUpdate(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource) (result CassandraClustersCreateUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.CreateUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "CreateUpdate", err.Error()) + } + + req, err := client.CreateUpdatePreparer(ctx, resourceGroupName, clusterName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "CreateUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "CreateUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdatePreparer prepares the CreateUpdate request. +func (client CassandraClustersClient) CreateUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSender sends the CreateUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) CreateUpdateSender(req *http.Request) (future CassandraClustersCreateUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateResponder handles the response to the CreateUpdate request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) CreateUpdateResponder(resp *http.Response) (result ClusterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a managed Cassandra cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +func (client CassandraClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result CassandraClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CassandraClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) DeleteSender(req *http.Request) (future CassandraClustersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FetchNodeStatus request the status of all nodes in the cluster (as returned by 'nodetool status'). +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +func (client CassandraClustersClient) FetchNodeStatus(ctx context.Context, resourceGroupName string, clusterName string) (result CassandraClustersFetchNodeStatusFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.FetchNodeStatus") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "FetchNodeStatus", err.Error()) + } + + req, err := client.FetchNodeStatusPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "FetchNodeStatus", nil, "Failure preparing request") + return + } + + result, err = client.FetchNodeStatusSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "FetchNodeStatus", result.Response(), "Failure sending request") + return + } + + return +} + +// FetchNodeStatusPreparer prepares the FetchNodeStatus request. +func (client CassandraClustersClient) FetchNodeStatusPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/fetchNodeStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FetchNodeStatusSender sends the FetchNodeStatus request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) FetchNodeStatusSender(req *http.Request) (future CassandraClustersFetchNodeStatusFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FetchNodeStatusResponder handles the response to the FetchNodeStatus request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) FetchNodeStatusResponder(resp *http.Response) (result ClusterNodeStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the properties of a managed Cassandra cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +func (client CassandraClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result ClusterResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CassandraClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) GetResponder(resp *http.Response) (result ClusterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackup get the properties of an individual backup of this cluster that is available to restore. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// backupID - id of a restorable backup of a Cassandra cluster. +func (client CassandraClustersClient) GetBackup(ctx context.Context, resourceGroupName string, clusterName string, backupID string) (result BackupResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.GetBackup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: backupID, + Constraints: []validation.Constraint{{Target: "backupID", Name: validation.MaxLength, Rule: 15, Chain: nil}, + {Target: "backupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backupID", Name: validation.Pattern, Rule: `^[0-9]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "GetBackup", err.Error()) + } + + req, err := client.GetBackupPreparer(ctx, resourceGroupName, clusterName, backupID) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "GetBackup", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "GetBackup", resp, "Failure sending request") + return + } + + result, err = client.GetBackupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "GetBackup", resp, "Failure responding to request") + return + } + + return +} + +// GetBackupPreparer prepares the GetBackup request. +func (client CassandraClustersClient) GetBackupPreparer(ctx context.Context, resourceGroupName string, clusterName string, backupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupSender sends the GetBackup request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) GetBackupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBackupResponder handles the response to the GetBackup request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) GetBackupResponder(resp *http.Response) (result BackupResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBackupsMethod list the backups of this cluster that are available to restore. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +func (client CassandraClustersClient) ListBackupsMethod(ctx context.Context, resourceGroupName string, clusterName string) (result ListBackups, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.ListBackupsMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "ListBackupsMethod", err.Error()) + } + + req, err := client.ListBackupsMethodPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBackupsMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupsMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBackupsMethod", resp, "Failure sending request") + return + } + + result, err = client.ListBackupsMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBackupsMethod", resp, "Failure responding to request") + return + } + + return +} + +// ListBackupsMethodPreparer prepares the ListBackupsMethod request. +func (client CassandraClustersClient) ListBackupsMethodPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupsMethodSender sends the ListBackupsMethod request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) ListBackupsMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBackupsMethodResponder handles the response to the ListBackupsMethod request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) ListBackupsMethodResponder(resp *http.Response) (result ListBackups, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list all managed Cassandra clusters in this resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client CassandraClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListClusters, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CassandraClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ListClusters, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription list all managed Cassandra clusters in this subscription. +func (client CassandraClustersClient) ListBySubscription(ctx context.Context) (result ListClusters, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "ListBySubscription", err.Error()) + } + + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "ListBySubscription", resp, "Failure responding to request") + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CassandraClustersClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) ListBySubscriptionResponder(resp *http.Response) (result ListClusters, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RequestRepair request that repair begin on this cluster as soon as possible. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// body - specification of what keyspaces and tables to run repair on. +func (client CassandraClustersClient) RequestRepair(ctx context.Context, resourceGroupName string, clusterName string, body RepairPostBody) (result CassandraClustersRequestRepairFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.RequestRepair") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Keyspace", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "RequestRepair", err.Error()) + } + + req, err := client.RequestRepairPreparer(ctx, resourceGroupName, clusterName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "RequestRepair", nil, "Failure preparing request") + return + } + + result, err = client.RequestRepairSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "RequestRepair", result.Response(), "Failure sending request") + return + } + + return +} + +// RequestRepairPreparer prepares the RequestRepair request. +func (client CassandraClustersClient) RequestRepairPreparer(ctx context.Context, resourceGroupName string, clusterName string, body RepairPostBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repair", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RequestRepairSender sends the RequestRepair request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) RequestRepairSender(req *http.Request) (future CassandraClustersRequestRepairFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RequestRepairResponder handles the response to the RequestRepair request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) RequestRepairResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates some of the properties of a managed Cassandra cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// body - parameters to provide for specifying the managed Cassandra cluster. +func (client CassandraClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource) (result CassandraClustersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraClustersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraClustersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CassandraClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraClustersClient) UpdateSender(req *http.Request) (future CassandraClustersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CassandraClustersClient) UpdateResponder(resp *http.Response) (result ClusterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandradatacenters.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandradatacenters.go new file mode 100644 index 000000000000..ef80c2fb7a5d --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandradatacenters.go @@ -0,0 +1,517 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CassandraDataCentersClient is the client for the CassandraDataCenters methods of the Documentdb service. +type CassandraDataCentersClient struct { + BaseClient +} + +// NewCassandraDataCentersClient creates an instance of the CassandraDataCentersClient client. +func NewCassandraDataCentersClient(subscriptionID string) CassandraDataCentersClient { + return NewCassandraDataCentersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCassandraDataCentersClientWithBaseURI creates an instance of the CassandraDataCentersClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCassandraDataCentersClientWithBaseURI(baseURI string, subscriptionID string) CassandraDataCentersClient { + return CassandraDataCentersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdate create or update a managed Cassandra data center. When updating, overwrite all properties. To update +// only some properties, use PATCH. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// dataCenterName - data center name in a managed Cassandra cluster. +// body - parameters specifying the managed Cassandra data center. +func (client CassandraDataCentersClient) CreateUpdate(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource) (result CassandraDataCentersCreateUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraDataCentersClient.CreateUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataCenterName, + Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraDataCentersClient", "CreateUpdate", err.Error()) + } + + req, err := client.CreateUpdatePreparer(ctx, resourceGroupName, clusterName, dataCenterName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "CreateUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "CreateUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdatePreparer prepares the CreateUpdate request. +func (client CassandraDataCentersClient) CreateUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "dataCenterName": autorest.Encode("path", dataCenterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSender sends the CreateUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraDataCentersClient) CreateUpdateSender(req *http.Request) (future CassandraDataCentersCreateUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateResponder handles the response to the CreateUpdate request. The method always +// closes the http.Response Body. +func (client CassandraDataCentersClient) CreateUpdateResponder(resp *http.Response) (result DataCenterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a managed Cassandra data center. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// dataCenterName - data center name in a managed Cassandra cluster. +func (client CassandraDataCentersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (result CassandraDataCentersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraDataCentersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataCenterName, + Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraDataCentersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, dataCenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CassandraDataCentersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "dataCenterName": autorest.Encode("path", dataCenterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraDataCentersClient) DeleteSender(req *http.Request) (future CassandraDataCentersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CassandraDataCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the properties of a managed Cassandra data center. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// dataCenterName - data center name in a managed Cassandra cluster. +func (client CassandraDataCentersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (result DataCenterResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraDataCentersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataCenterName, + Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraDataCentersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, dataCenterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CassandraDataCentersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "dataCenterName": autorest.Encode("path", dataCenterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraDataCentersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CassandraDataCentersClient) GetResponder(resp *http.Response) (result DataCenterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all data centers in a particular managed Cassandra cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +func (client CassandraDataCentersClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result ListDataCenters, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraDataCentersClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraDataCentersClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client CassandraDataCentersClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraDataCentersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CassandraDataCentersClient) ListResponder(resp *http.Response) (result ListDataCenters, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update some of the properties of a managed Cassandra data center. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - managed Cassandra cluster name. +// dataCenterName - data center name in a managed Cassandra cluster. +// body - parameters to provide for specifying the managed Cassandra data center. +func (client CassandraDataCentersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource) (result CassandraDataCentersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraDataCentersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {TargetValue: dataCenterName, + Constraints: []validation.Constraint{{Target: "dataCenterName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "dataCenterName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "dataCenterName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraDataCentersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, dataCenterName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CassandraDataCentersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "dataCenterName": autorest.Encode("path", dataCenterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraDataCentersClient) UpdateSender(req *http.Request) (future CassandraDataCentersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CassandraDataCentersClient) UpdateResponder(resp *http.Response) (result DataCenterResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraresources.go new file mode 100644 index 000000000000..b6b3951c1a41 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/cassandraresources.go @@ -0,0 +1,2350 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CassandraResourcesClient is the client for the CassandraResources methods of the Documentdb service. +type CassandraResourcesClient struct { + BaseClient +} + +// NewCassandraResourcesClient creates an instance of the CassandraResourcesClient client. +func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { + return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCassandraResourcesClientWithBaseURI creates an instance of the CassandraResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { + return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateCassandraKeyspace create or update an Azure Cosmos DB Cassandra keyspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// createUpdateCassandraKeyspaceParameters - the parameters to provide for the current Cassandra keyspace. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraKeyspace") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateCassandraKeyspaceParameters, + Constraints: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraKeyspaceParameters.CassandraKeyspaceCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", err.Error()) + } + + req, err := client.CreateUpdateCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateCassandraKeyspaceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraKeyspace", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateCassandraKeyspacePreparer prepares the CreateUpdateCassandraKeyspace request. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithJSON(createUpdateCassandraKeyspaceParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateCassandraKeyspaceSender sends the CreateUpdateCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateCassandraKeyspaceResponder handles the response to the CreateUpdateCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateCassandraTable create or update an Azure Cosmos DB Cassandra Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +// createUpdateCassandraTableParameters - the parameters to provide for the current Cassandra Table. +func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateCassandraTableParameters, + Constraints: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraTableParameters.CassandraTableCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", err.Error()) + } + + req, err := client.CreateUpdateCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateCassandraTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraTable", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateCassandraTablePreparer prepares the CreateUpdateCassandraTable request. +func (client CassandraResourcesClient) CreateUpdateCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithJSON(createUpdateCassandraTableParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateCassandraTableSender sends the CreateUpdateCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) CreateUpdateCassandraTableSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateCassandraTableResponder handles the response to the CreateUpdateCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) CreateUpdateCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateCassandraView create or update an Azure Cosmos DB Cassandra View +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +// createUpdateCassandraViewParameters - the parameters to provide for the current Cassandra View. +func (client CassandraResourcesClient) CreateUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters) (result CassandraResourcesCreateUpdateCassandraViewFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.CreateUpdateCassandraView") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateCassandraViewParameters, + Constraints: []validation.Constraint{{Target: "createUpdateCassandraViewParameters.CassandraViewCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraViewParameters.CassandraViewCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateCassandraViewParameters.CassandraViewCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateCassandraViewParameters.CassandraViewCreateUpdateProperties.Resource.ViewDefinition", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "CreateUpdateCassandraView", err.Error()) + } + + req, err := client.CreateUpdateCassandraViewPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraView", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateCassandraViewSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "CreateUpdateCassandraView", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateCassandraViewPreparer prepares the CreateUpdateCassandraView request. +func (client CassandraResourcesClient) CreateUpdateCassandraViewPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", pathParameters), + autorest.WithJSON(createUpdateCassandraViewParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateCassandraViewSender sends the CreateUpdateCassandraView request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) CreateUpdateCassandraViewSender(req *http.Request) (future CassandraResourcesCreateUpdateCassandraViewFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateCassandraViewResponder handles the response to the CreateUpdateCassandraView request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) CreateUpdateCassandraViewResponder(resp *http.Response) (result CassandraViewGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCassandraKeyspace deletes an existing Azure Cosmos DB Cassandra keyspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesDeleteCassandraKeyspaceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraKeyspace") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", err.Error()) + } + + req, err := client.DeleteCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", nil, "Failure preparing request") + return + } + + result, err = client.DeleteCassandraKeyspaceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraKeyspace", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteCassandraKeyspacePreparer prepares the DeleteCassandraKeyspace request. +func (client CassandraResourcesClient) DeleteCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCassandraKeyspaceSender sends the DeleteCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) DeleteCassandraKeyspaceSender(req *http.Request) (future CassandraResourcesDeleteCassandraKeyspaceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteCassandraKeyspaceResponder handles the response to the DeleteCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) DeleteCassandraKeyspaceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteCassandraTable deletes an existing Azure Cosmos DB Cassandra table. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesDeleteCassandraTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraTable", err.Error()) + } + + req, err := client.DeleteCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", nil, "Failure preparing request") + return + } + + result, err = client.DeleteCassandraTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraTable", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteCassandraTablePreparer prepares the DeleteCassandraTable request. +func (client CassandraResourcesClient) DeleteCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCassandraTableSender sends the DeleteCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) DeleteCassandraTableSender(req *http.Request) (future CassandraResourcesDeleteCassandraTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteCassandraTableResponder handles the response to the DeleteCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) DeleteCassandraTableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteCassandraView deletes an existing Azure Cosmos DB Cassandra view. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +func (client CassandraResourcesClient) DeleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result CassandraResourcesDeleteCassandraViewFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.DeleteCassandraView") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "DeleteCassandraView", err.Error()) + } + + req, err := client.DeleteCassandraViewPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraView", nil, "Failure preparing request") + return + } + + result, err = client.DeleteCassandraViewSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "DeleteCassandraView", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteCassandraViewPreparer prepares the DeleteCassandraView request. +func (client CassandraResourcesClient) DeleteCassandraViewPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCassandraViewSender sends the DeleteCassandraView request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) DeleteCassandraViewSender(req *http.Request) (future CassandraResourcesDeleteCassandraViewFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteCassandraViewResponder handles the response to the DeleteCassandraView request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) DeleteCassandraViewResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetCassandraKeyspace gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the +// provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraKeyspaceGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspace", err.Error()) + } + + req, err := client.GetCassandraKeyspacePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraKeyspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraKeyspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspace", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraKeyspacePreparer prepares the GetCassandraKeyspace request. +func (client CassandraResourcesClient) GetCassandraKeyspacePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraKeyspaceSender sends the GetCassandraKeyspace request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraKeyspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraKeyspaceResponder handles the response to the GetCassandraKeyspace request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraKeyspaceResponder(resp *http.Response) (result CassandraKeyspaceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraKeyspaceThroughput gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraKeyspaceThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", err.Error()) + } + + req, err := client.GetCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraKeyspaceThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraKeyspaceThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraKeyspaceThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraKeyspaceThroughputPreparer prepares the GetCassandraKeyspaceThroughput request. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraKeyspaceThroughputSender sends the GetCassandraKeyspaceThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraKeyspaceThroughputResponder handles the response to the GetCassandraKeyspaceThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraTable gets the Cassandra table under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraTableGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTable", err.Error()) + } + + req, err := client.GetCassandraTablePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraTableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTable", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraTablePreparer prepares the GetCassandraTable request. +func (client CassandraResourcesClient) GetCassandraTablePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraTableSender sends the GetCassandraTable request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraTableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraTableResponder handles the response to the GetCassandraTable request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraTableResponder(resp *http.Response) (result CassandraTableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraTableThroughput gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraTableThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", err.Error()) + } + + req, err := client.GetCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraTableThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraTableThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraTableThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraTableThroughputPreparer prepares the GetCassandraTableThroughput request. +func (client CassandraResourcesClient) GetCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraTableThroughputSender sends the GetCassandraTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraTableThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraTableThroughputResponder handles the response to the GetCassandraTableThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraView gets the Cassandra view under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +func (client CassandraResourcesClient) GetCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result CassandraViewGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraView", err.Error()) + } + + req, err := client.GetCassandraViewPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraView", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraView", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraView", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraViewPreparer prepares the GetCassandraView request. +func (client CassandraResourcesClient) GetCassandraViewPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraViewSender sends the GetCassandraView request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraViewResponder handles the response to the GetCassandraView request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraViewResponder(resp *http.Response) (result CassandraViewGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCassandraViewThroughput gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database +// account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +func (client CassandraResourcesClient) GetCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.GetCassandraViewThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "GetCassandraViewThroughput", err.Error()) + } + + req, err := client.GetCassandraViewThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraViewThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetCassandraViewThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraViewThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetCassandraViewThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "GetCassandraViewThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetCassandraViewThroughputPreparer prepares the GetCassandraViewThroughput request. +func (client CassandraResourcesClient) GetCassandraViewThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCassandraViewThroughputSender sends the GetCassandraViewThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) GetCassandraViewThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCassandraViewThroughputResponder handles the response to the GetCassandraViewThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) GetCassandraViewThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListCassandraKeyspaces lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result CassandraKeyspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraKeyspaces") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", err.Error()) + } + + req, err := client.ListCassandraKeyspacesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", nil, "Failure preparing request") + return + } + + resp, err := client.ListCassandraKeyspacesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure sending request") + return + } + + result, err = client.ListCassandraKeyspacesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraKeyspaces", resp, "Failure responding to request") + return + } + + return +} + +// ListCassandraKeyspacesPreparer prepares the ListCassandraKeyspaces request. +func (client CassandraResourcesClient) ListCassandraKeyspacesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCassandraKeyspacesSender sends the ListCassandraKeyspaces request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) ListCassandraKeyspacesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCassandraKeyspacesResponder handles the response to the ListCassandraKeyspaces request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) ListCassandraKeyspacesResponder(resp *http.Response) (result CassandraKeyspaceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListCassandraTables lists the Cassandra table under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraTableListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraTables") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraTables", err.Error()) + } + + req, err := client.ListCassandraTablesPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", nil, "Failure preparing request") + return + } + + resp, err := client.ListCassandraTablesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure sending request") + return + } + + result, err = client.ListCassandraTablesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraTables", resp, "Failure responding to request") + return + } + + return +} + +// ListCassandraTablesPreparer prepares the ListCassandraTables request. +func (client CassandraResourcesClient) ListCassandraTablesPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCassandraTablesSender sends the ListCassandraTables request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) ListCassandraTablesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCassandraTablesResponder handles the response to the ListCassandraTables request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) ListCassandraTablesResponder(resp *http.Response) (result CassandraTableListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListCassandraViews lists the Cassandra materialized views under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) ListCassandraViews(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraViewListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.ListCassandraViews") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "ListCassandraViews", err.Error()) + } + + req, err := client.ListCassandraViewsPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraViews", nil, "Failure preparing request") + return + } + + resp, err := client.ListCassandraViewsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraViews", resp, "Failure sending request") + return + } + + result, err = client.ListCassandraViewsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "ListCassandraViews", resp, "Failure responding to request") + return + } + + return +} + +// ListCassandraViewsPreparer prepares the ListCassandraViews request. +func (client CassandraResourcesClient) ListCassandraViewsPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCassandraViewsSender sends the ListCassandraViews request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) ListCassandraViewsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCassandraViewsResponder handles the response to the ListCassandraViews request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) ListCassandraViewsResponder(resp *http.Response) (result CassandraViewListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraKeyspaceToAutoscale migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to +// autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", err.Error()) + } + + req, err := client.MigrateCassandraKeyspaceToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraKeyspaceToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraKeyspaceToAutoscalePreparer prepares the MigrateCassandraKeyspaceToAutoscale request. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraKeyspaceToAutoscaleSender sends the MigrateCassandraKeyspaceToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraKeyspaceToAutoscaleResponder handles the response to the MigrateCassandraKeyspaceToAutoscale request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraKeyspaceToManualThroughput migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraKeyspaceToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", err.Error()) + } + + req, err := client.MigrateCassandraKeyspaceToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraKeyspaceToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraKeyspaceToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraKeyspaceToManualThroughputPreparer prepares the MigrateCassandraKeyspaceToManualThroughput request. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraKeyspaceToManualThroughputSender sends the MigrateCassandraKeyspaceToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraKeyspaceToManualThroughputResponder handles the response to the MigrateCassandraKeyspaceToManualThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraKeyspaceToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraTableToAutoscale migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", err.Error()) + } + + req, err := client.MigrateCassandraTableToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraTableToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraTableToAutoscalePreparer prepares the MigrateCassandraTableToAutoscale request. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraTableToAutoscaleSender sends the MigrateCassandraTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraTableToAutoscaleResponder handles the response to the MigrateCassandraTableToAutoscale request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraTableToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraTableToManualThroughput migrate an Azure Cosmos DB Cassandra table from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraTableToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", err.Error()) + } + + req, err := client.MigrateCassandraTableToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraTableToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraTableToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraTableToManualThroughputPreparer prepares the MigrateCassandraTableToManualThroughput request. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraTableToManualThroughputSender sends the MigrateCassandraTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraTableToManualThroughputResponder handles the response to the MigrateCassandraTableToManualThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraTableToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraViewToAutoscale migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +func (client CassandraResourcesClient) MigrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result CassandraResourcesMigrateCassandraViewToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraViewToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraViewToAutoscale", err.Error()) + } + + req, err := client.MigrateCassandraViewToAutoscalePreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraViewToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraViewToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraViewToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraViewToAutoscalePreparer prepares the MigrateCassandraViewToAutoscale request. +func (client CassandraResourcesClient) MigrateCassandraViewToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraViewToAutoscaleSender sends the MigrateCassandraViewToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraViewToAutoscaleSender(req *http.Request) (future CassandraResourcesMigrateCassandraViewToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraViewToAutoscaleResponder handles the response to the MigrateCassandraViewToAutoscale request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraViewToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateCassandraViewToManualThroughput migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +func (client CassandraResourcesClient) MigrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result CassandraResourcesMigrateCassandraViewToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.MigrateCassandraViewToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "MigrateCassandraViewToManualThroughput", err.Error()) + } + + req, err := client.MigrateCassandraViewToManualThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraViewToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateCassandraViewToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "MigrateCassandraViewToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateCassandraViewToManualThroughputPreparer prepares the MigrateCassandraViewToManualThroughput request. +func (client CassandraResourcesClient) MigrateCassandraViewToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateCassandraViewToManualThroughputSender sends the MigrateCassandraViewToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) MigrateCassandraViewToManualThroughputSender(req *http.Request) (future CassandraResourcesMigrateCassandraViewToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateCassandraViewToManualThroughputResponder handles the response to the MigrateCassandraViewToManualThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) MigrateCassandraViewToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCassandraKeyspaceThroughput update RUs per second of an Azure Cosmos DB Cassandra Keyspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra +// Keyspace. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraKeyspaceThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", err.Error()) + } + + req, err := client.UpdateCassandraKeyspaceThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateCassandraKeyspaceThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraKeyspaceThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateCassandraKeyspaceThroughputPreparer prepares the UpdateCassandraKeyspaceThroughput request. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCassandraKeyspaceThroughputSender sends the UpdateCassandraKeyspaceThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateCassandraKeyspaceThroughputResponder handles the response to the UpdateCassandraKeyspaceThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCassandraTableThroughput update RUs per second of an Azure Cosmos DB Cassandra table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// tableName - cosmos DB table name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra +// table. +func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraTableThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraTableThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", err.Error()) + } + + req, err := client.UpdateCassandraTableThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateCassandraTableThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraTableThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateCassandraTableThroughputPreparer prepares the UpdateCassandraTableThroughput request. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCassandraTableThroughputSender sends the UpdateCassandraTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraTableThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateCassandraTableThroughputResponder handles the response to the UpdateCassandraTableThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) UpdateCassandraTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCassandraViewThroughput update RUs per second of an Azure Cosmos DB Cassandra view +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyspaceName - cosmos DB keyspace name. +// viewName - cosmos DB view name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra view. +func (client CassandraResourcesClient) UpdateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result CassandraResourcesUpdateCassandraViewThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CassandraResourcesClient.UpdateCassandraViewThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.CassandraResourcesClient", "UpdateCassandraViewThroughput", err.Error()) + } + + req, err := client.UpdateCassandraViewThroughputPreparer(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraViewThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateCassandraViewThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesClient", "UpdateCassandraViewThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateCassandraViewThroughputPreparer prepares the UpdateCassandraViewThroughput request. +func (client CassandraResourcesClient) UpdateCassandraViewThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "keyspaceName": autorest.Encode("path", keyspaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "viewName": autorest.Encode("path", viewName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCassandraViewThroughputSender sends the UpdateCassandraViewThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client CassandraResourcesClient) UpdateCassandraViewThroughputSender(req *http.Request) (future CassandraResourcesUpdateCassandraViewThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateCassandraViewThroughputResponder handles the response to the UpdateCassandraViewThroughput request. The method always +// closes the http.Response Body. +func (client CassandraResourcesClient) UpdateCassandraViewThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/client.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/client.go new file mode 100644 index 000000000000..6c867b5f7a4e --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/client.go @@ -0,0 +1,203 @@ +// Package documentdb implements the Azure ARM Documentdb service API version 2021-07-01-preview. +// +// +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Documentdb + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Documentdb. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// LocationGet get the properties of an existing Cosmos DB location +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +func (client BaseClient) LocationGet(ctx context.Context, location string) (result LocationGetResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LocationGet") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.BaseClient", "LocationGet", err.Error()) + } + + req, err := client.LocationGetPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationGet", nil, "Failure preparing request") + return + } + + resp, err := client.LocationGetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationGet", resp, "Failure sending request") + return + } + + result, err = client.LocationGetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationGet", resp, "Failure responding to request") + return + } + + return +} + +// LocationGetPreparer prepares the LocationGet request. +func (client BaseClient) LocationGetPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LocationGetSender sends the LocationGet request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) LocationGetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// LocationGetResponder handles the response to the LocationGet request. The method always +// closes the http.Response Body. +func (client BaseClient) LocationGetResponder(resp *http.Response) (result LocationGetResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// LocationList list Cosmos DB locations and their properties +func (client BaseClient) LocationList(ctx context.Context) (result LocationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LocationList") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.BaseClient", "LocationList", err.Error()) + } + + req, err := client.LocationListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationList", nil, "Failure preparing request") + return + } + + resp, err := client.LocationListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationList", resp, "Failure sending request") + return + } + + result, err = client.LocationListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.BaseClient", "LocationList", resp, "Failure responding to request") + return + } + + return +} + +// LocationListPreparer prepares the LocationList request. +func (client BaseClient) LocationListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LocationListSender sends the LocationList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) LocationListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// LocationListResponder handles the response to the LocationList request. The method always +// closes the http.Response Body. +func (client BaseClient) LocationListResponder(resp *http.Response) (result LocationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collection.go new file mode 100644 index 000000000000..812d95a1d096 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collection.go @@ -0,0 +1,320 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionClient is the client for the Collection methods of the Documentdb service. +type CollectionClient struct { + BaseClient +} + +// NewCollectionClient creates an instance of the CollectionClient client. +func NewCollectionClient(subscriptionID string) CollectionClient { + return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionClientWithBaseURI creates an instance of the CollectionClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return CollectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetricDefinitions retrieves metric definitions for the given collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client CollectionClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent storage data) for the given collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client CollectionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client CollectionClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartition.go new file mode 100644 index 000000000000..0f806a75004e --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartition.go @@ -0,0 +1,228 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionPartitionClient is the client for the CollectionPartition methods of the Documentdb service. +type CollectionPartitionClient struct { + BaseClient +} + +// NewCollectionPartitionClient creates an instance of the CollectionPartitionClient client. +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionClientWithBaseURI creates an instance of the CollectionPartitionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent storage data) for the given collection, split by partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client CollectionPartitionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionUsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client CollectionPartitionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListUsagesResponder(resp *http.Response) (result PartitionUsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartitionregion.go new file mode 100644 index 000000000000..09a3ea1b78c6 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionpartitionregion.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionPartitionRegionClient is the client for the CollectionPartitionRegion methods of the Documentdb service. +type CollectionPartitionRegionClient struct { + BaseClient +} + +// NewCollectionPartitionRegionClient creates an instance of the CollectionPartitionRegionClient client. +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionRegionClientWithBaseURI creates an instance of the CollectionPartitionRegionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by +// partition. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionPartitionRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionregion.go new file mode 100644 index 000000000000..eec73ecd5235 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/collectionregion.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CollectionRegionClient is the client for the CollectionRegion methods of the Documentdb service. +type CollectionRegionClient struct { + BaseClient +} + +// NewCollectionRegionClient creates an instance of the CollectionRegionClient client. +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionRegionClientWithBaseURI creates an instance of the CollectionRegionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and +// region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CollectionRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionRegionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/database.go new file mode 100644 index 000000000000..5bf79b5f43ae --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/database.go @@ -0,0 +1,314 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseClient is the client for the Database methods of the Documentdb service. +type DatabaseClient struct { + BaseClient +} + +// NewDatabaseClient creates an instance of the DatabaseClient client. +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseClientWithBaseURI creates an instance of the DatabaseClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetricDefinitions retrieves metric definitions for the given database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client DatabaseClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent data) for the given database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client DatabaseClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client DatabaseClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccountregion.go new file mode 100644 index 000000000000..14212a2d18c6 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccountregion.go @@ -0,0 +1,128 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseAccountRegionClient is the client for the DatabaseAccountRegion methods of the Documentdb service. +type DatabaseAccountRegionClient struct { + BaseClient +} + +// NewDatabaseAccountRegionClient creates an instance of the DatabaseAccountRegionClient client. +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseAccountRegionClientWithBaseURI creates an instance of the DatabaseAccountRegionClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account and region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseAccountRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseAccountRegionClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccounts.go new file mode 100644 index 000000000000..b30970e571f1 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/databaseaccounts.go @@ -0,0 +1,1676 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DatabaseAccountsClient is the client for the DatabaseAccounts methods of the Documentdb service. +type DatabaseAccountsClient struct { + BaseClient +} + +// NewDatabaseAccountsClient creates an instance of the DatabaseAccountsClient client. +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabaseAccountsClientWithBaseURI creates an instance of the DatabaseAccountsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only +// lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. +// Parameters: +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) CheckNameExists(ctx context.Context, accountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CheckNameExists") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CheckNameExists", err.Error()) + } + + req, err := client.CheckNameExistsPreparer(ctx, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", resp, "Failure sending request") + return + } + + result, err = client.CheckNameExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameExistsPreparer prepares the CheckNameExists request. +func (client DatabaseAccountsClient) CheckNameExistsPreparer(ctx context.Context, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameExistsSender sends the CheckNameExists request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) CheckNameExistsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckNameExistsResponder handles the response to the CheckNameExists request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) CheckNameExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when +// performing updates on an account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateParameters - the parameters to provide for the current database account. +func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters) (result DatabaseAccountsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateParameters, + Constraints: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMaximum, Rule: int64(2147483647), Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMaximum, Rule: int64(86400), Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, + }}, + }}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.Locations", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.DatabaseAccountOfferType", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, createUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabaseAccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithJSON(createUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) CreateOrUpdateSender(req *http.Request) (future DatabaseAccountsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatabaseAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) DeleteSender(req *http.Request) (future DatabaseAccountsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// FailoverPriorityChange changes the failover priority for the Azure Cosmos DB database account. A failover priority +// of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover +// priority values must be unique for each of the regions in which the database account exists. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// failoverParameters - the new failover policies for the database account. +func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies) (result DatabaseAccountsFailoverPriorityChangeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.FailoverPriorityChange") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: failoverParameters, + Constraints: []validation.Constraint{{Target: "failoverParameters.FailoverPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "FailoverPriorityChange", err.Error()) + } + + req, err := client.FailoverPriorityChangePreparer(ctx, resourceGroupName, accountName, failoverParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "FailoverPriorityChange", nil, "Failure preparing request") + return + } + + result, err = client.FailoverPriorityChangeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "FailoverPriorityChange", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverPriorityChangePreparer prepares the FailoverPriorityChange request. +func (client DatabaseAccountsClient) FailoverPriorityChangePreparer(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", pathParameters), + autorest.WithJSON(failoverParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverPriorityChangeSender sends the FailoverPriorityChange request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) FailoverPriorityChangeSender(req *http.Request) (future DatabaseAccountsFailoverPriorityChangeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// FailoverPriorityChangeResponder handles the response to the FailoverPriorityChange request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) FailoverPriorityChangeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the properties of an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabaseAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) GetResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.GetReadOnlyKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", err.Error()) + } + + req, err := client.GetReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetReadOnlyKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure sending request") + return + } + + result, err = client.GetReadOnlyKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure responding to request") + return + } + + return +} + +// GetReadOnlyKeysPreparer prepares the GetReadOnlyKeys request. +func (client DatabaseAccountsClient) GetReadOnlyKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReadOnlyKeysSender sends the GetReadOnlyKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) GetReadOnlyKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetReadOnlyKeysResponder handles the response to the GetReadOnlyKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) GetReadOnlyKeysResponder(resp *http.Response) (result DatabaseAccountListReadOnlyKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the Azure Cosmos DB database accounts available under the subscription. +func (client DatabaseAccountsClient) List(ctx context.Context) (result DatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DatabaseAccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListResponder(resp *http.Response) (result DatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all the Azure Cosmos DB database accounts available under the given resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DatabaseAccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result DatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionStrings lists the connection strings for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListConnectionStringsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListConnectionStrings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListConnectionStrings", err.Error()) + } + + req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionStringsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionStringsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionStringsPreparer prepares the ListConnectionStrings request. +func (client DatabaseAccountsClient) ListConnectionStringsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListConnectionStringsResponder(resp *http.Response) (result DatabaseAccountListConnectionStringsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListKeys lists the access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client DatabaseAccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListKeysResponder(resp *http.Response) (result DatabaseAccountListKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetricDefinitions retrieves metric definitions for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result MetricDefinitionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListMetricDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetricDefinitions", err.Error()) + } + + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. +func (client DatabaseAccountsClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricDefinitionsSender sends the ListMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricDefinitionsResponder handles the response to the ListMetricDefinitions request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListMetricDefinitionsResponder(resp *http.Response) (result MetricDefinitionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result MetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client DatabaseAccountsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListMetricsResponder(resp *http.Response) (result MetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListReadOnlyKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", err.Error()) + } + + req, err := client.ListReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListReadOnlyKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", resp, "Failure sending request") + return + } + + result, err = client.ListReadOnlyKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListReadOnlyKeysPreparer prepares the ListReadOnlyKeys request. +func (client DatabaseAccountsClient) ListReadOnlyKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListReadOnlyKeysSender sends the ListReadOnlyKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListReadOnlyKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListReadOnlyKeysResponder handles the response to the ListReadOnlyKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListReadOnlyKeysResponder(resp *http.Response) (result DatabaseAccountListReadOnlyKeysResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent data) for the given database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of usages to return. The supported parameter is +// name.value (name of the metric, can have an or of multiple names). +func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result UsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client DatabaseAccountsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) ListUsagesResponder(resp *http.Response) (result UsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// OfflineRegion offline the specified region for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// regionParameterForOffline - cosmos DB region to offline for the database account. +func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline) (result DatabaseAccountsOfflineRegionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.OfflineRegion") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: regionParameterForOffline, + Constraints: []validation.Constraint{{Target: "regionParameterForOffline.Region", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "OfflineRegion", err.Error()) + } + + req, err := client.OfflineRegionPreparer(ctx, resourceGroupName, accountName, regionParameterForOffline) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OfflineRegion", nil, "Failure preparing request") + return + } + + result, err = client.OfflineRegionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OfflineRegion", result.Response(), "Failure sending request") + return + } + + return +} + +// OfflineRegionPreparer prepares the OfflineRegion request. +func (client DatabaseAccountsClient) OfflineRegionPreparer(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion", pathParameters), + autorest.WithJSON(regionParameterForOffline), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// OfflineRegionSender sends the OfflineRegion request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) OfflineRegionSender(req *http.Request) (future DatabaseAccountsOfflineRegionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// OfflineRegionResponder handles the response to the OfflineRegion request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) OfflineRegionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// OnlineRegion online the specified region for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// regionParameterForOnline - cosmos DB region to online for the database account. +func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline) (result DatabaseAccountsOnlineRegionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.OnlineRegion") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: regionParameterForOnline, + Constraints: []validation.Constraint{{Target: "regionParameterForOnline.Region", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "OnlineRegion", err.Error()) + } + + req, err := client.OnlineRegionPreparer(ctx, resourceGroupName, accountName, regionParameterForOnline) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OnlineRegion", nil, "Failure preparing request") + return + } + + result, err = client.OnlineRegionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "OnlineRegion", result.Response(), "Failure sending request") + return + } + + return +} + +// OnlineRegionPreparer prepares the OnlineRegion request. +func (client DatabaseAccountsClient) OnlineRegionPreparer(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion", pathParameters), + autorest.WithJSON(regionParameterForOnline), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// OnlineRegionSender sends the OnlineRegion request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) OnlineRegionSender(req *http.Request) (future DatabaseAccountsOnlineRegionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// OnlineRegionResponder handles the response to the OnlineRegion request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) OnlineRegionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateKey regenerates an access key for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// keyToRegenerate - the name of the key to regenerate. +func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters) (result DatabaseAccountsRegenerateKeyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.RegenerateKey") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, keyToRegenerate) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + result, err = client.RegenerateKeySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "RegenerateKey", result.Response(), "Failure sending request") + return + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client DatabaseAccountsClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", pathParameters), + autorest.WithJSON(keyToRegenerate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) RegenerateKeySender(req *http.Request) (future DatabaseAccountsRegenerateKeyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) RegenerateKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates the properties of an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// updateParameters - the parameters to provide for the current database account. +func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters) (result DatabaseAccountsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, updateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DatabaseAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", pathParameters), + autorest.WithJSON(updateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) UpdateSender(req *http.Request) (future DatabaseAccountsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) UpdateResponder(resp *http.Response) (result DatabaseAccountGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/documentdbapi/interfaces.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/documentdbapi/interfaces.go new file mode 100644 index 000000000000..d07a62904b9d --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/documentdbapi/interfaces.go @@ -0,0 +1,395 @@ +package documentdbapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + LocationGet(ctx context.Context, location string) (result documentdb.LocationGetResult, err error) + LocationList(ctx context.Context) (result documentdb.LocationListResult, err error) +} + +var _ BaseClientAPI = (*documentdb.BaseClient)(nil) + +// DatabaseAccountsClientAPI contains the set of methods on the DatabaseAccountsClient type. +type DatabaseAccountsClientAPI interface { + CheckNameExists(ctx context.Context, accountName string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters documentdb.DatabaseAccountCreateUpdateParameters) (result documentdb.DatabaseAccountsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountsDeleteFuture, err error) + FailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters documentdb.FailoverPolicies) (result documentdb.DatabaseAccountsFailoverPriorityChangeFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountGetResults, err error) + GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) + List(ctx context.Context) (result documentdb.DatabaseAccountsListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result documentdb.DatabaseAccountsListResult, err error) + ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListConnectionStringsResult, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListKeysResult, err error) + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.MetricListResult, err error) + ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.DatabaseAccountListReadOnlyKeysResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.UsagesResult, err error) + OfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline documentdb.RegionForOnlineOffline) (result documentdb.DatabaseAccountsOfflineRegionFuture, err error) + OnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline documentdb.RegionForOnlineOffline) (result documentdb.DatabaseAccountsOnlineRegionFuture, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate documentdb.DatabaseAccountRegenerateKeyParameters) (result documentdb.DatabaseAccountsRegenerateKeyFuture, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, updateParameters documentdb.DatabaseAccountUpdateParameters) (result documentdb.DatabaseAccountsUpdateFuture, err error) +} + +var _ DatabaseAccountsClientAPI = (*documentdb.DatabaseAccountsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result documentdb.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result documentdb.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*documentdb.OperationsClient)(nil) + +// DatabaseClientAPI contains the set of methods on the DatabaseClient type. +type DatabaseClientAPI interface { + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result documentdb.MetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result documentdb.UsagesResult, err error) +} + +var _ DatabaseClientAPI = (*documentdb.DatabaseClient)(nil) + +// CollectionClientAPI contains the set of methods on the CollectionClient type. +type CollectionClientAPI interface { + ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result documentdb.MetricDefinitionsListResult, err error) + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.MetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.UsagesResult, err error) +} + +var _ CollectionClientAPI = (*documentdb.CollectionClient)(nil) + +// CollectionRegionClientAPI contains the set of methods on the CollectionRegionClient type. +type CollectionRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result documentdb.MetricListResult, err error) +} + +var _ CollectionRegionClientAPI = (*documentdb.CollectionRegionClient)(nil) + +// DatabaseAccountRegionClientAPI contains the set of methods on the DatabaseAccountRegionClient type. +type DatabaseAccountRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (result documentdb.MetricListResult, err error) +} + +var _ DatabaseAccountRegionClientAPI = (*documentdb.DatabaseAccountRegionClient)(nil) + +// PercentileSourceTargetClientAPI contains the set of methods on the PercentileSourceTargetClient type. +type PercentileSourceTargetClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileSourceTargetClientAPI = (*documentdb.PercentileSourceTargetClient)(nil) + +// PercentileTargetClientAPI contains the set of methods on the PercentileTargetClient type. +type PercentileTargetClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileTargetClientAPI = (*documentdb.PercentileTargetClient)(nil) + +// PercentileClientAPI contains the set of methods on the PercentileClient type. +type PercentileClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result documentdb.PercentileMetricListResult, err error) +} + +var _ PercentileClientAPI = (*documentdb.PercentileClient)(nil) + +// CollectionPartitionRegionClientAPI contains the set of methods on the CollectionPartitionRegionClient type. +type CollectionPartitionRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ CollectionPartitionRegionClientAPI = (*documentdb.CollectionPartitionRegionClient)(nil) + +// CollectionPartitionClientAPI contains the set of methods on the CollectionPartitionClient type. +type CollectionPartitionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionMetricListResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result documentdb.PartitionUsagesResult, err error) +} + +var _ CollectionPartitionClientAPI = (*documentdb.CollectionPartitionClient)(nil) + +// PartitionKeyRangeIDClientAPI contains the set of methods on the PartitionKeyRangeIDClient type. +type PartitionKeyRangeIDClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ PartitionKeyRangeIDClientAPI = (*documentdb.PartitionKeyRangeIDClient)(nil) + +// PartitionKeyRangeIDRegionClientAPI contains the set of methods on the PartitionKeyRangeIDRegionClient type. +type PartitionKeyRangeIDRegionClientAPI interface { + ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result documentdb.PartitionMetricListResult, err error) +} + +var _ PartitionKeyRangeIDRegionClientAPI = (*documentdb.PartitionKeyRangeIDRegionClient)(nil) + +// GraphResourcesClientAPI contains the set of methods on the GraphResourcesClient type. +type GraphResourcesClientAPI interface { + CreateUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters documentdb.GraphResourceCreateUpdateParameters) (result documentdb.GraphResourcesCreateUpdateGraphFuture, err error) + DeleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string) (result documentdb.GraphResourcesDeleteGraphResourceFuture, err error) + GetGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string) (result documentdb.GraphResourceGetResults, err error) + ListGraphs(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.GraphResourcesListResult, err error) +} + +var _ GraphResourcesClientAPI = (*documentdb.GraphResourcesClient)(nil) + +// SQLResourcesClientAPI contains the set of methods on the SQLResourcesClient type. +type SQLResourcesClientAPI interface { + CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters documentdb.SQLContainerCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLContainerFuture, err error) + CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters documentdb.SQLDatabaseCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture, err error) + CreateUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters documentdb.SQLRoleAssignmentCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) + CreateUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters documentdb.SQLRoleDefinitionCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) + CreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters documentdb.SQLStoredProcedureCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) + CreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters documentdb.SQLTriggerCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLTriggerFuture, err error) + CreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters documentdb.SQLUserDefinedFunctionCreateUpdateParameters) (result documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) + DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesDeleteSQLContainerFuture, err error) + DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesDeleteSQLDatabaseFuture, err error) + DeleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture, err error) + DeleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture, err error) + DeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result documentdb.SQLResourcesDeleteSQLStoredProcedureFuture, err error) + DeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result documentdb.SQLResourcesDeleteSQLTriggerFuture, err error) + DeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) + GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLContainerGetResults, err error) + GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLDatabaseGetResults, err error) + GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result documentdb.SQLRoleAssignmentGetResults, err error) + GetSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result documentdb.SQLRoleDefinitionGetResults, err error) + GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result documentdb.SQLStoredProcedureGetResults, err error) + GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result documentdb.SQLTriggerGetResults, err error) + GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result documentdb.SQLUserDefinedFunctionGetResults, err error) + ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLContainerListResult, err error) + ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLDatabaseListResult, err error) + ListSQLRoleAssignments(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLRoleAssignmentListResult, err error) + ListSQLRoleDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.SQLRoleDefinitionListResult, err error) + ListSQLStoredProcedures(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLStoredProcedureListResult, err error) + ListSQLTriggers(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLTriggerListResult, err error) + ListSQLUserDefinedFunctions(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLUserDefinedFunctionListResult, err error) + MigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) + MigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) + MigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) + MigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) + RetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location documentdb.ContinuousBackupRestoreLocation) (result documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture, err error) + UpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.SQLResourcesUpdateSQLContainerThroughputFuture, err error) + UpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) +} + +var _ SQLResourcesClientAPI = (*documentdb.SQLResourcesClient)(nil) + +// MongoDBResourcesClientAPI contains the set of methods on the MongoDBResourcesClient type. +type MongoDBResourcesClientAPI interface { + CreateUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters documentdb.MongoDBCollectionCreateUpdateParameters) (result documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) + CreateUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters documentdb.MongoDBDatabaseCreateUpdateParameters) (result documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) + DeleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture, err error) + DeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) + GetMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBCollectionGetResults, err error) + GetMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBDatabaseGetResults, err error) + GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListMongoDBCollections(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBCollectionListResult, err error) + ListMongoDBDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.MongoDBDatabaseListResult, err error) + MigrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) + MigrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) + MigrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) + MigrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) + UpdateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) + UpdateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) +} + +var _ MongoDBResourcesClientAPI = (*documentdb.MongoDBResourcesClient)(nil) + +// TableResourcesClientAPI contains the set of methods on the TableResourcesClient type. +type TableResourcesClientAPI interface { + CreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters documentdb.TableCreateUpdateParameters) (result documentdb.TableResourcesCreateUpdateTableFuture, err error) + DeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesDeleteTableFuture, err error) + GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableGetResults, err error) + GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListTables(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.TableListResult, err error) + MigrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesMigrateTableToAutoscaleFuture, err error) + MigrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result documentdb.TableResourcesMigrateTableToManualThroughputFuture, err error) + UpdateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.TableResourcesUpdateTableThroughputFuture, err error) +} + +var _ TableResourcesClientAPI = (*documentdb.TableResourcesClient)(nil) + +// CassandraResourcesClientAPI contains the set of methods on the CassandraResourcesClient type. +type CassandraResourcesClientAPI interface { + CreateUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters documentdb.CassandraKeyspaceCreateUpdateParameters) (result documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture, err error) + CreateUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters documentdb.CassandraTableCreateUpdateParameters) (result documentdb.CassandraResourcesCreateUpdateCassandraTableFuture, err error) + CreateUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters documentdb.CassandraViewCreateUpdateParameters) (result documentdb.CassandraResourcesCreateUpdateCassandraViewFuture, err error) + DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture, err error) + DeleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesDeleteCassandraTableFuture, err error) + DeleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result documentdb.CassandraResourcesDeleteCassandraViewFuture, err error) + GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraKeyspaceGetResults, err error) + GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraTableGetResults, err error) + GetCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result documentdb.CassandraViewGetResults, err error) + GetCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.CassandraKeyspaceListResult, err error) + ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraTableListResult, err error) + ListCassandraViews(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraViewListResult, err error) + MigrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture, err error) + MigrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture, err error) + MigrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture, err error) + MigrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string) (result documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture, err error) + MigrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result documentdb.CassandraResourcesMigrateCassandraViewToAutoscaleFuture, err error) + MigrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string) (result documentdb.CassandraResourcesMigrateCassandraViewToManualThroughputFuture, err error) + UpdateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture, err error) + UpdateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture, err error) + UpdateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.CassandraResourcesUpdateCassandraViewThroughputFuture, err error) +} + +var _ CassandraResourcesClientAPI = (*documentdb.CassandraResourcesClient)(nil) + +// GremlinResourcesClientAPI contains the set of methods on the GremlinResourcesClient type. +type GremlinResourcesClientAPI interface { + CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters documentdb.GremlinDatabaseCreateUpdateParameters) (result documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) + CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters documentdb.GremlinGraphCreateUpdateParameters) (result documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture, err error) + DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesDeleteGremlinDatabaseFuture, err error) + DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesDeleteGremlinGraphFuture, err error) + GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinDatabaseGetResults, err error) + GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.ThroughputSettingsGetResults, err error) + GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinGraphGetResults, err error) + GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.ThroughputSettingsGetResults, err error) + ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.GremlinDatabaseListResult, err error) + ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinGraphListResult, err error) + MigrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) + MigrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) + MigrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) + MigrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) + UpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) + UpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters documentdb.ThroughputSettingsUpdateParameters) (result documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) +} + +var _ GremlinResourcesClientAPI = (*documentdb.GremlinResourcesClient)(nil) + +// NotebookWorkspacesClientAPI contains the set of methods on the NotebookWorkspacesClient type. +type NotebookWorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters documentdb.NotebookWorkspaceCreateUpdateParameters) (result documentdb.NotebookWorkspacesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspace, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspaceListResult, err error) + ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspaceConnectionInfoResult, err error) + RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesRegenerateAuthTokenFuture, err error) + Start(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.NotebookWorkspacesStartFuture, err error) +} + +var _ NotebookWorkspacesClientAPI = (*documentdb.NotebookWorkspacesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters documentdb.PrivateEndpointConnection) (result documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result documentdb.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result documentdb.PrivateEndpointConnection, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.PrivateEndpointConnectionListResult, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*documentdb.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result documentdb.PrivateLinkResource, err error) + ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*documentdb.PrivateLinkResourcesClient)(nil) + +// RestorableDatabaseAccountsClientAPI contains the set of methods on the RestorableDatabaseAccountsClient type. +type RestorableDatabaseAccountsClientAPI interface { + GetByLocation(ctx context.Context, location string, instanceID string) (result documentdb.RestorableDatabaseAccountGetResult, err error) + List(ctx context.Context) (result documentdb.RestorableDatabaseAccountsListResult, err error) + ListByLocation(ctx context.Context, location string) (result documentdb.RestorableDatabaseAccountsListResult, err error) +} + +var _ RestorableDatabaseAccountsClientAPI = (*documentdb.RestorableDatabaseAccountsClient)(nil) + +// RestorableSQLDatabasesClientAPI contains the set of methods on the RestorableSQLDatabasesClient type. +type RestorableSQLDatabasesClientAPI interface { + List(ctx context.Context, location string, instanceID string) (result documentdb.RestorableSQLDatabasesListResult, err error) +} + +var _ RestorableSQLDatabasesClientAPI = (*documentdb.RestorableSQLDatabasesClient)(nil) + +// RestorableSQLContainersClientAPI contains the set of methods on the RestorableSQLContainersClient type. +type RestorableSQLContainersClientAPI interface { + List(ctx context.Context, location string, instanceID string, restorableSQLDatabaseRid string, startTime string, endTime string) (result documentdb.RestorableSQLContainersListResult, err error) +} + +var _ RestorableSQLContainersClientAPI = (*documentdb.RestorableSQLContainersClient)(nil) + +// RestorableSQLResourcesClientAPI contains the set of methods on the RestorableSQLResourcesClient type. +type RestorableSQLResourcesClientAPI interface { + List(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (result documentdb.RestorableSQLResourcesListResult, err error) +} + +var _ RestorableSQLResourcesClientAPI = (*documentdb.RestorableSQLResourcesClient)(nil) + +// RestorableMongodbDatabasesClientAPI contains the set of methods on the RestorableMongodbDatabasesClient type. +type RestorableMongodbDatabasesClientAPI interface { + List(ctx context.Context, location string, instanceID string) (result documentdb.RestorableMongodbDatabasesListResult, err error) +} + +var _ RestorableMongodbDatabasesClientAPI = (*documentdb.RestorableMongodbDatabasesClient)(nil) + +// RestorableMongodbCollectionsClientAPI contains the set of methods on the RestorableMongodbCollectionsClient type. +type RestorableMongodbCollectionsClientAPI interface { + List(ctx context.Context, location string, instanceID string, restorableMongodbDatabaseRid string) (result documentdb.RestorableMongodbCollectionsListResult, err error) +} + +var _ RestorableMongodbCollectionsClientAPI = (*documentdb.RestorableMongodbCollectionsClient)(nil) + +// RestorableMongodbResourcesClientAPI contains the set of methods on the RestorableMongodbResourcesClient type. +type RestorableMongodbResourcesClientAPI interface { + List(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (result documentdb.RestorableMongodbResourcesListResult, err error) +} + +var _ RestorableMongodbResourcesClientAPI = (*documentdb.RestorableMongodbResourcesClient)(nil) + +// CassandraClustersClientAPI contains the set of methods on the CassandraClustersClient type. +type CassandraClustersClientAPI interface { + CreateUpdate(ctx context.Context, resourceGroupName string, clusterName string, body documentdb.ClusterResource) (result documentdb.CassandraClustersCreateUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result documentdb.CassandraClustersDeleteFuture, err error) + FetchNodeStatus(ctx context.Context, resourceGroupName string, clusterName string) (result documentdb.CassandraClustersFetchNodeStatusFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result documentdb.ClusterResource, err error) + GetBackup(ctx context.Context, resourceGroupName string, clusterName string, backupID string) (result documentdb.BackupResource, err error) + ListBackupsMethod(ctx context.Context, resourceGroupName string, clusterName string) (result documentdb.ListBackups, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result documentdb.ListClusters, err error) + ListBySubscription(ctx context.Context) (result documentdb.ListClusters, err error) + RequestRepair(ctx context.Context, resourceGroupName string, clusterName string, body documentdb.RepairPostBody) (result documentdb.CassandraClustersRequestRepairFuture, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, body documentdb.ClusterResource) (result documentdb.CassandraClustersUpdateFuture, err error) +} + +var _ CassandraClustersClientAPI = (*documentdb.CassandraClustersClient)(nil) + +// CassandraDataCentersClientAPI contains the set of methods on the CassandraDataCentersClient type. +type CassandraDataCentersClientAPI interface { + CreateUpdate(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body documentdb.DataCenterResource) (result documentdb.CassandraDataCentersCreateUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (result documentdb.CassandraDataCentersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string) (result documentdb.DataCenterResource, err error) + List(ctx context.Context, resourceGroupName string, clusterName string) (result documentdb.ListDataCenters, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body documentdb.DataCenterResource) (result documentdb.CassandraDataCentersUpdateFuture, err error) +} + +var _ CassandraDataCentersClientAPI = (*documentdb.CassandraDataCentersClient)(nil) + +// ServiceClientAPI contains the set of methods on the ServiceClient type. +type ServiceClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters documentdb.ServiceResourceCreateUpdateParameters) (result documentdb.ServiceCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result documentdb.ServiceDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result documentdb.ServiceResource, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result documentdb.ServiceResourceListResult, err error) +} + +var _ ServiceClientAPI = (*documentdb.ServiceClient)(nil) diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/enums.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/enums.go new file mode 100644 index 000000000000..63eefe318e64 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/enums.go @@ -0,0 +1,718 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AnalyticalStorageSchemaType enumerates the values for analytical storage schema type. +type AnalyticalStorageSchemaType string + +const ( + // FullFidelity ... + FullFidelity AnalyticalStorageSchemaType = "FullFidelity" + // WellDefined ... + WellDefined AnalyticalStorageSchemaType = "WellDefined" +) + +// PossibleAnalyticalStorageSchemaTypeValues returns an array of possible values for the AnalyticalStorageSchemaType const type. +func PossibleAnalyticalStorageSchemaTypeValues() []AnalyticalStorageSchemaType { + return []AnalyticalStorageSchemaType{FullFidelity, WellDefined} +} + +// APIType enumerates the values for api type. +type APIType string + +const ( + // Cassandra ... + Cassandra APIType = "Cassandra" + // Gremlin ... + Gremlin APIType = "Gremlin" + // GremlinV2 ... + GremlinV2 APIType = "GremlinV2" + // MongoDB ... + MongoDB APIType = "MongoDB" + // SQL ... + SQL APIType = "Sql" + // Table ... + Table APIType = "Table" +) + +// PossibleAPITypeValues returns an array of possible values for the APIType const type. +func PossibleAPITypeValues() []APIType { + return []APIType{Cassandra, Gremlin, GremlinV2, MongoDB, SQL, Table} +} + +// AuthenticationMethod enumerates the values for authentication method. +type AuthenticationMethod string + +const ( + // AuthenticationMethodCassandra ... + AuthenticationMethodCassandra AuthenticationMethod = "Cassandra" + // AuthenticationMethodNone ... + AuthenticationMethodNone AuthenticationMethod = "None" +) + +// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. +func PossibleAuthenticationMethodValues() []AuthenticationMethod { + return []AuthenticationMethod{AuthenticationMethodCassandra, AuthenticationMethodNone} +} + +// BackupPolicyMigrationStatus enumerates the values for backup policy migration status. +type BackupPolicyMigrationStatus string + +const ( + // Completed ... + Completed BackupPolicyMigrationStatus = "Completed" + // Failed ... + Failed BackupPolicyMigrationStatus = "Failed" + // InProgress ... + InProgress BackupPolicyMigrationStatus = "InProgress" + // Invalid ... + Invalid BackupPolicyMigrationStatus = "Invalid" +) + +// PossibleBackupPolicyMigrationStatusValues returns an array of possible values for the BackupPolicyMigrationStatus const type. +func PossibleBackupPolicyMigrationStatusValues() []BackupPolicyMigrationStatus { + return []BackupPolicyMigrationStatus{Completed, Failed, InProgress, Invalid} +} + +// BackupPolicyType enumerates the values for backup policy type. +type BackupPolicyType string + +const ( + // Continuous ... + Continuous BackupPolicyType = "Continuous" + // Periodic ... + Periodic BackupPolicyType = "Periodic" +) + +// PossibleBackupPolicyTypeValues returns an array of possible values for the BackupPolicyType const type. +func PossibleBackupPolicyTypeValues() []BackupPolicyType { + return []BackupPolicyType{Continuous, Periodic} +} + +// BackupStorageRedundancy enumerates the values for backup storage redundancy. +type BackupStorageRedundancy string + +const ( + // Geo ... + Geo BackupStorageRedundancy = "Geo" + // Local ... + Local BackupStorageRedundancy = "Local" + // Zone ... + Zone BackupStorageRedundancy = "Zone" +) + +// PossibleBackupStorageRedundancyValues returns an array of possible values for the BackupStorageRedundancy const type. +func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { + return []BackupStorageRedundancy{Geo, Local, Zone} +} + +// CompositePathSortOrder enumerates the values for composite path sort order. +type CompositePathSortOrder string + +const ( + // Ascending ... + Ascending CompositePathSortOrder = "ascending" + // Descending ... + Descending CompositePathSortOrder = "descending" +) + +// PossibleCompositePathSortOrderValues returns an array of possible values for the CompositePathSortOrder const type. +func PossibleCompositePathSortOrderValues() []CompositePathSortOrder { + return []CompositePathSortOrder{Ascending, Descending} +} + +// ConflictResolutionMode enumerates the values for conflict resolution mode. +type ConflictResolutionMode string + +const ( + // Custom ... + Custom ConflictResolutionMode = "Custom" + // LastWriterWins ... + LastWriterWins ConflictResolutionMode = "LastWriterWins" +) + +// PossibleConflictResolutionModeValues returns an array of possible values for the ConflictResolutionMode const type. +func PossibleConflictResolutionModeValues() []ConflictResolutionMode { + return []ConflictResolutionMode{Custom, LastWriterWins} +} + +// ConnectorOffer enumerates the values for connector offer. +type ConnectorOffer string + +const ( + // Small ... + Small ConnectorOffer = "Small" +) + +// PossibleConnectorOfferValues returns an array of possible values for the ConnectorOffer const type. +func PossibleConnectorOfferValues() []ConnectorOffer { + return []ConnectorOffer{Small} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // Default ... + Default CreateMode = "Default" + // Restore ... + Restore CreateMode = "Restore" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{Default, Restore} +} + +// DatabaseAccountKind enumerates the values for database account kind. +type DatabaseAccountKind string + +const ( + // DatabaseAccountKindGlobalDocumentDB ... + DatabaseAccountKindGlobalDocumentDB DatabaseAccountKind = "GlobalDocumentDB" + // DatabaseAccountKindMongoDB ... + DatabaseAccountKindMongoDB DatabaseAccountKind = "MongoDB" + // DatabaseAccountKindParse ... + DatabaseAccountKindParse DatabaseAccountKind = "Parse" +) + +// PossibleDatabaseAccountKindValues returns an array of possible values for the DatabaseAccountKind const type. +func PossibleDatabaseAccountKindValues() []DatabaseAccountKind { + return []DatabaseAccountKind{DatabaseAccountKindGlobalDocumentDB, DatabaseAccountKindMongoDB, DatabaseAccountKindParse} +} + +// DatabaseAccountOfferType enumerates the values for database account offer type. +type DatabaseAccountOfferType string + +const ( + // Standard ... + Standard DatabaseAccountOfferType = "Standard" +) + +// PossibleDatabaseAccountOfferTypeValues returns an array of possible values for the DatabaseAccountOfferType const type. +func PossibleDatabaseAccountOfferTypeValues() []DatabaseAccountOfferType { + return []DatabaseAccountOfferType{Standard} +} + +// DataType enumerates the values for data type. +type DataType string + +const ( + // LineString ... + LineString DataType = "LineString" + // MultiPolygon ... + MultiPolygon DataType = "MultiPolygon" + // Number ... + Number DataType = "Number" + // Point ... + Point DataType = "Point" + // Polygon ... + Polygon DataType = "Polygon" + // String ... + String DataType = "String" +) + +// PossibleDataTypeValues returns an array of possible values for the DataType const type. +func PossibleDataTypeValues() []DataType { + return []DataType{LineString, MultiPolygon, Number, Point, Polygon, String} +} + +// DefaultConsistencyLevel enumerates the values for default consistency level. +type DefaultConsistencyLevel string + +const ( + // BoundedStaleness ... + BoundedStaleness DefaultConsistencyLevel = "BoundedStaleness" + // ConsistentPrefix ... + ConsistentPrefix DefaultConsistencyLevel = "ConsistentPrefix" + // Eventual ... + Eventual DefaultConsistencyLevel = "Eventual" + // Session ... + Session DefaultConsistencyLevel = "Session" + // Strong ... + Strong DefaultConsistencyLevel = "Strong" +) + +// PossibleDefaultConsistencyLevelValues returns an array of possible values for the DefaultConsistencyLevel const type. +func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { + return []DefaultConsistencyLevel{BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong} +} + +// EnableFullTextQuery enumerates the values for enable full text query. +type EnableFullTextQuery string + +const ( + // False ... + False EnableFullTextQuery = "False" + // None ... + None EnableFullTextQuery = "None" + // True ... + True EnableFullTextQuery = "True" +) + +// PossibleEnableFullTextQueryValues returns an array of possible values for the EnableFullTextQuery const type. +func PossibleEnableFullTextQueryValues() []EnableFullTextQuery { + return []EnableFullTextQuery{False, None, True} +} + +// IndexingMode enumerates the values for indexing mode. +type IndexingMode string + +const ( + // IndexingModeConsistent ... + IndexingModeConsistent IndexingMode = "consistent" + // IndexingModeLazy ... + IndexingModeLazy IndexingMode = "lazy" + // IndexingModeNone ... + IndexingModeNone IndexingMode = "none" +) + +// PossibleIndexingModeValues returns an array of possible values for the IndexingMode const type. +func PossibleIndexingModeValues() []IndexingMode { + return []IndexingMode{IndexingModeConsistent, IndexingModeLazy, IndexingModeNone} +} + +// IndexKind enumerates the values for index kind. +type IndexKind string + +const ( + // Hash ... + Hash IndexKind = "Hash" + // Range ... + Range IndexKind = "Range" + // Spatial ... + Spatial IndexKind = "Spatial" +) + +// PossibleIndexKindValues returns an array of possible values for the IndexKind const type. +func PossibleIndexKindValues() []IndexKind { + return []IndexKind{Hash, Range, Spatial} +} + +// KeyKind enumerates the values for key kind. +type KeyKind string + +const ( + // Primary ... + Primary KeyKind = "primary" + // PrimaryReadonly ... + PrimaryReadonly KeyKind = "primaryReadonly" + // Secondary ... + Secondary KeyKind = "secondary" + // SecondaryReadonly ... + SecondaryReadonly KeyKind = "secondaryReadonly" +) + +// PossibleKeyKindValues returns an array of possible values for the KeyKind const type. +func PossibleKeyKindValues() []KeyKind { + return []KeyKind{Primary, PrimaryReadonly, Secondary, SecondaryReadonly} +} + +// ManagedCassandraProvisioningState enumerates the values for managed cassandra provisioning state. +type ManagedCassandraProvisioningState string + +const ( + // ManagedCassandraProvisioningStateCanceled ... + ManagedCassandraProvisioningStateCanceled ManagedCassandraProvisioningState = "Canceled" + // ManagedCassandraProvisioningStateCreating ... + ManagedCassandraProvisioningStateCreating ManagedCassandraProvisioningState = "Creating" + // ManagedCassandraProvisioningStateDeleting ... + ManagedCassandraProvisioningStateDeleting ManagedCassandraProvisioningState = "Deleting" + // ManagedCassandraProvisioningStateFailed ... + ManagedCassandraProvisioningStateFailed ManagedCassandraProvisioningState = "Failed" + // ManagedCassandraProvisioningStateSucceeded ... + ManagedCassandraProvisioningStateSucceeded ManagedCassandraProvisioningState = "Succeeded" + // ManagedCassandraProvisioningStateUpdating ... + ManagedCassandraProvisioningStateUpdating ManagedCassandraProvisioningState = "Updating" +) + +// PossibleManagedCassandraProvisioningStateValues returns an array of possible values for the ManagedCassandraProvisioningState const type. +func PossibleManagedCassandraProvisioningStateValues() []ManagedCassandraProvisioningState { + return []ManagedCassandraProvisioningState{ManagedCassandraProvisioningStateCanceled, ManagedCassandraProvisioningStateCreating, ManagedCassandraProvisioningStateDeleting, ManagedCassandraProvisioningStateFailed, ManagedCassandraProvisioningStateSucceeded, ManagedCassandraProvisioningStateUpdating} +} + +// NetworkACLBypass enumerates the values for network acl bypass. +type NetworkACLBypass string + +const ( + // NetworkACLBypassAzureServices ... + NetworkACLBypassAzureServices NetworkACLBypass = "AzureServices" + // NetworkACLBypassNone ... + NetworkACLBypassNone NetworkACLBypass = "None" +) + +// PossibleNetworkACLBypassValues returns an array of possible values for the NetworkACLBypass const type. +func PossibleNetworkACLBypassValues() []NetworkACLBypass { + return []NetworkACLBypass{NetworkACLBypassAzureServices, NetworkACLBypassNone} +} + +// NodeState enumerates the values for node state. +type NodeState string + +const ( + // Joining ... + Joining NodeState = "Joining" + // Leaving ... + Leaving NodeState = "Leaving" + // Moving ... + Moving NodeState = "Moving" + // Normal ... + Normal NodeState = "Normal" + // Stopped ... + Stopped NodeState = "Stopped" +) + +// PossibleNodeStateValues returns an array of possible values for the NodeState const type. +func PossibleNodeStateValues() []NodeState { + return []NodeState{Joining, Leaving, Moving, Normal, Stopped} +} + +// NodeStatus enumerates the values for node status. +type NodeStatus string + +const ( + // Down ... + Down NodeStatus = "Down" + // Up ... + Up NodeStatus = "Up" +) + +// PossibleNodeStatusValues returns an array of possible values for the NodeStatus const type. +func PossibleNodeStatusValues() []NodeStatus { + return []NodeStatus{Down, Up} +} + +// OperationType enumerates the values for operation type. +type OperationType string + +const ( + // Create ... + Create OperationType = "Create" + // Delete ... + Delete OperationType = "Delete" + // Replace ... + Replace OperationType = "Replace" + // SystemOperation ... + SystemOperation OperationType = "SystemOperation" +) + +// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. +func PossibleOperationTypeValues() []OperationType { + return []OperationType{Create, Delete, Replace, SystemOperation} +} + +// PartitionKind enumerates the values for partition kind. +type PartitionKind string + +const ( + // PartitionKindHash ... + PartitionKindHash PartitionKind = "Hash" + // PartitionKindMultiHash ... + PartitionKindMultiHash PartitionKind = "MultiHash" + // PartitionKindRange ... + PartitionKindRange PartitionKind = "Range" +) + +// PossiblePartitionKindValues returns an array of possible values for the PartitionKind const type. +func PossiblePartitionKindValues() []PartitionKind { + return []PartitionKind{PartitionKindHash, PartitionKindMultiHash, PartitionKindRange} +} + +// PrimaryAggregationType enumerates the values for primary aggregation type. +type PrimaryAggregationType string + +const ( + // PrimaryAggregationTypeAverage ... + PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" + // PrimaryAggregationTypeLast ... + PrimaryAggregationTypeLast PrimaryAggregationType = "Last" + // PrimaryAggregationTypeMaximum ... + PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" + // PrimaryAggregationTypeMinimum ... + PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" + // PrimaryAggregationTypeNone ... + PrimaryAggregationTypeNone PrimaryAggregationType = "None" + // PrimaryAggregationTypeTotal ... + PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" +) + +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeLast, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned,UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RestoreMode enumerates the values for restore mode. +type RestoreMode string + +const ( + // PointInTime ... + PointInTime RestoreMode = "PointInTime" +) + +// PossibleRestoreModeValues returns an array of possible values for the RestoreMode const type. +func PossibleRestoreModeValues() []RestoreMode { + return []RestoreMode{PointInTime} +} + +// RoleDefinitionType enumerates the values for role definition type. +type RoleDefinitionType string + +const ( + // BuiltInRole ... + BuiltInRole RoleDefinitionType = "BuiltInRole" + // CustomRole ... + CustomRole RoleDefinitionType = "CustomRole" +) + +// PossibleRoleDefinitionTypeValues returns an array of possible values for the RoleDefinitionType const type. +func PossibleRoleDefinitionTypeValues() []RoleDefinitionType { + return []RoleDefinitionType{BuiltInRole, CustomRole} +} + +// ServerVersion enumerates the values for server version. +type ServerVersion string + +const ( + // FourFullStopZero ... + FourFullStopZero ServerVersion = "4.0" + // ThreeFullStopSix ... + ThreeFullStopSix ServerVersion = "3.6" + // ThreeFullStopTwo ... + ThreeFullStopTwo ServerVersion = "3.2" +) + +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{FourFullStopZero, ThreeFullStopSix, ThreeFullStopTwo} +} + +// ServiceSize enumerates the values for service size. +type ServiceSize string + +const ( + // CosmosD16s ... + CosmosD16s ServiceSize = "Cosmos.D16s" + // CosmosD4s ... + CosmosD4s ServiceSize = "Cosmos.D4s" + // CosmosD8s ... + CosmosD8s ServiceSize = "Cosmos.D8s" +) + +// PossibleServiceSizeValues returns an array of possible values for the ServiceSize const type. +func PossibleServiceSizeValues() []ServiceSize { + return []ServiceSize{CosmosD16s, CosmosD4s, CosmosD8s} +} + +// ServiceStatus enumerates the values for service status. +type ServiceStatus string + +const ( + // ServiceStatusCreating ... + ServiceStatusCreating ServiceStatus = "Creating" + // ServiceStatusDeleting ... + ServiceStatusDeleting ServiceStatus = "Deleting" + // ServiceStatusError ... + ServiceStatusError ServiceStatus = "Error" + // ServiceStatusRunning ... + ServiceStatusRunning ServiceStatus = "Running" + // ServiceStatusStopped ... + ServiceStatusStopped ServiceStatus = "Stopped" + // ServiceStatusUpdating ... + ServiceStatusUpdating ServiceStatus = "Updating" +) + +// PossibleServiceStatusValues returns an array of possible values for the ServiceStatus const type. +func PossibleServiceStatusValues() []ServiceStatus { + return []ServiceStatus{ServiceStatusCreating, ServiceStatusDeleting, ServiceStatusError, ServiceStatusRunning, ServiceStatusStopped, ServiceStatusUpdating} +} + +// ServiceType enumerates the values for service type. +type ServiceType string + +const ( + // DataTransfer ... + DataTransfer ServiceType = "DataTransfer" + // GraphAPICompute ... + GraphAPICompute ServiceType = "GraphAPICompute" + // SQLDedicatedGateway ... + SQLDedicatedGateway ServiceType = "SqlDedicatedGateway" +) + +// PossibleServiceTypeValues returns an array of possible values for the ServiceType const type. +func PossibleServiceTypeValues() []ServiceType { + return []ServiceType{DataTransfer, GraphAPICompute, SQLDedicatedGateway} +} + +// ServiceTypeBasicServiceResourceProperties enumerates the values for service type basic service resource +// properties. +type ServiceTypeBasicServiceResourceProperties string + +const ( + // ServiceTypeDataTransfer ... + ServiceTypeDataTransfer ServiceTypeBasicServiceResourceProperties = "DataTransfer" + // ServiceTypeGraphAPICompute ... + ServiceTypeGraphAPICompute ServiceTypeBasicServiceResourceProperties = "GraphAPICompute" + // ServiceTypeServiceResourceProperties ... + ServiceTypeServiceResourceProperties ServiceTypeBasicServiceResourceProperties = "ServiceResourceProperties" + // ServiceTypeSQLDedicatedGateway ... + ServiceTypeSQLDedicatedGateway ServiceTypeBasicServiceResourceProperties = "SqlDedicatedGateway" +) + +// PossibleServiceTypeBasicServiceResourcePropertiesValues returns an array of possible values for the ServiceTypeBasicServiceResourceProperties const type. +func PossibleServiceTypeBasicServiceResourcePropertiesValues() []ServiceTypeBasicServiceResourceProperties { + return []ServiceTypeBasicServiceResourceProperties{ServiceTypeDataTransfer, ServiceTypeGraphAPICompute, ServiceTypeServiceResourceProperties, ServiceTypeSQLDedicatedGateway} +} + +// SpatialType enumerates the values for spatial type. +type SpatialType string + +const ( + // SpatialTypeLineString ... + SpatialTypeLineString SpatialType = "LineString" + // SpatialTypeMultiPolygon ... + SpatialTypeMultiPolygon SpatialType = "MultiPolygon" + // SpatialTypePoint ... + SpatialTypePoint SpatialType = "Point" + // SpatialTypePolygon ... + SpatialTypePolygon SpatialType = "Polygon" +) + +// PossibleSpatialTypeValues returns an array of possible values for the SpatialType const type. +func PossibleSpatialTypeValues() []SpatialType { + return []SpatialType{SpatialTypeLineString, SpatialTypeMultiPolygon, SpatialTypePoint, SpatialTypePolygon} +} + +// TriggerOperation enumerates the values for trigger operation. +type TriggerOperation string + +const ( + // TriggerOperationAll ... + TriggerOperationAll TriggerOperation = "All" + // TriggerOperationCreate ... + TriggerOperationCreate TriggerOperation = "Create" + // TriggerOperationDelete ... + TriggerOperationDelete TriggerOperation = "Delete" + // TriggerOperationReplace ... + TriggerOperationReplace TriggerOperation = "Replace" + // TriggerOperationUpdate ... + TriggerOperationUpdate TriggerOperation = "Update" +) + +// PossibleTriggerOperationValues returns an array of possible values for the TriggerOperation const type. +func PossibleTriggerOperationValues() []TriggerOperation { + return []TriggerOperation{TriggerOperationAll, TriggerOperationCreate, TriggerOperationDelete, TriggerOperationReplace, TriggerOperationUpdate} +} + +// TriggerType enumerates the values for trigger type. +type TriggerType string + +const ( + // Post ... + Post TriggerType = "Post" + // Pre ... + Pre TriggerType = "Pre" +) + +// PossibleTriggerTypeValues returns an array of possible values for the TriggerType const type. +func PossibleTriggerTypeValues() []TriggerType { + return []TriggerType{Post, Pre} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeBackupPolicy ... + TypeBackupPolicy Type = "BackupPolicy" + // TypeContinuous ... + TypeContinuous Type = "Continuous" + // TypePeriodic ... + TypePeriodic Type = "Periodic" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeBackupPolicy, TypeContinuous, TypePeriodic} +} + +// UnitType enumerates the values for unit type. +type UnitType string + +const ( + // Bytes ... + Bytes UnitType = "Bytes" + // BytesPerSecond ... + BytesPerSecond UnitType = "BytesPerSecond" + // Count ... + Count UnitType = "Count" + // CountPerSecond ... + CountPerSecond UnitType = "CountPerSecond" + // Milliseconds ... + Milliseconds UnitType = "Milliseconds" + // Percent ... + Percent UnitType = "Percent" + // Seconds ... + Seconds UnitType = "Seconds" +) + +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, Percent, Seconds} +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/graphresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/graphresources.go new file mode 100644 index 000000000000..487b6a56a6ef --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/graphresources.go @@ -0,0 +1,407 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GraphResourcesClient is the client for the GraphResources methods of the Documentdb service. +type GraphResourcesClient struct { + BaseClient +} + +// NewGraphResourcesClient creates an instance of the GraphResourcesClient client. +func NewGraphResourcesClient(subscriptionID string) GraphResourcesClient { + return NewGraphResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGraphResourcesClientWithBaseURI creates an instance of the GraphResourcesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGraphResourcesClientWithBaseURI(baseURI string, subscriptionID string) GraphResourcesClient { + return GraphResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateGraph create or update an Azure Cosmos DB Graph. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// graphName - cosmos DB graph resource name. +// createUpdateGraphParameters - the parameters to provide for the current graph. +func (client GraphResourcesClient) CreateUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters) (result GraphResourcesCreateUpdateGraphFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GraphResourcesClient.CreateUpdateGraph") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateGraphParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGraphParameters.GraphResourceCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGraphParameters.GraphResourceCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGraphParameters.GraphResourceCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GraphResourcesClient", "CreateUpdateGraph", err.Error()) + } + + req, err := client.CreateUpdateGraphPreparer(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "CreateUpdateGraph", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateGraphSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "CreateUpdateGraph", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateGraphPreparer prepares the CreateUpdateGraph request. +func (client GraphResourcesClient) CreateUpdateGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", pathParameters), + autorest.WithJSON(createUpdateGraphParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateGraphSender sends the CreateUpdateGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GraphResourcesClient) CreateUpdateGraphSender(req *http.Request) (future GraphResourcesCreateUpdateGraphFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateGraphResponder handles the response to the CreateUpdateGraph request. The method always +// closes the http.Response Body. +func (client GraphResourcesClient) CreateUpdateGraphResponder(resp *http.Response) (result GraphResourceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteGraphResource deletes an existing Azure Cosmos DB Graph Resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// graphName - cosmos DB graph resource name. +func (client GraphResourcesClient) DeleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string) (result GraphResourcesDeleteGraphResourceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GraphResourcesClient.DeleteGraphResource") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GraphResourcesClient", "DeleteGraphResource", err.Error()) + } + + req, err := client.DeleteGraphResourcePreparer(ctx, resourceGroupName, accountName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "DeleteGraphResource", nil, "Failure preparing request") + return + } + + result, err = client.DeleteGraphResourceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "DeleteGraphResource", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteGraphResourcePreparer prepares the DeleteGraphResource request. +func (client GraphResourcesClient) DeleteGraphResourcePreparer(ctx context.Context, resourceGroupName string, accountName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteGraphResourceSender sends the DeleteGraphResource request. The method will close the +// http.Response Body if it receives an error. +func (client GraphResourcesClient) DeleteGraphResourceSender(req *http.Request) (future GraphResourcesDeleteGraphResourceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteGraphResourceResponder handles the response to the DeleteGraphResource request. The method always +// closes the http.Response Body. +func (client GraphResourcesClient) DeleteGraphResourceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetGraph gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// graphName - cosmos DB graph resource name. +func (client GraphResourcesClient) GetGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string) (result GraphResourceGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GraphResourcesClient.GetGraph") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GraphResourcesClient", "GetGraph", err.Error()) + } + + req, err := client.GetGraphPreparer(ctx, resourceGroupName, accountName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "GetGraph", nil, "Failure preparing request") + return + } + + resp, err := client.GetGraphSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "GetGraph", resp, "Failure sending request") + return + } + + result, err = client.GetGraphResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "GetGraph", resp, "Failure responding to request") + return + } + + return +} + +// GetGraphPreparer prepares the GetGraph request. +func (client GraphResourcesClient) GetGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGraphSender sends the GetGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GraphResourcesClient) GetGraphSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGraphResponder handles the response to the GetGraph request. The method always +// closes the http.Response Body. +func (client GraphResourcesClient) GetGraphResponder(resp *http.Response) (result GraphResourceGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGraphs lists the graphs under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client GraphResourcesClient) ListGraphs(ctx context.Context, resourceGroupName string, accountName string) (result GraphResourcesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GraphResourcesClient.ListGraphs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GraphResourcesClient", "ListGraphs", err.Error()) + } + + req, err := client.ListGraphsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "ListGraphs", nil, "Failure preparing request") + return + } + + resp, err := client.ListGraphsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "ListGraphs", resp, "Failure sending request") + return + } + + result, err = client.ListGraphsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesClient", "ListGraphs", resp, "Failure responding to request") + return + } + + return +} + +// ListGraphsPreparer prepares the ListGraphs request. +func (client GraphResourcesClient) ListGraphsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGraphsSender sends the ListGraphs request. The method will close the +// http.Response Body if it receives an error. +func (client GraphResourcesClient) ListGraphsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGraphsResponder handles the response to the ListGraphs request. The method always +// closes the http.Response Body. +func (client GraphResourcesClient) ListGraphsResponder(resp *http.Response) (result GraphResourcesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/gremlinresources.go new file mode 100644 index 000000000000..0ded5e9adf6a --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/gremlinresources.go @@ -0,0 +1,1577 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GremlinResourcesClient is the client for the GremlinResources methods of the Documentdb service. +type GremlinResourcesClient struct { + BaseClient +} + +// NewGremlinResourcesClient creates an instance of the GremlinResourcesClient client. +func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { + return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGremlinResourcesClientWithBaseURI creates an instance of the GremlinResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { + return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateGremlinDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinDatabaseParameters.GremlinDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", err.Error()) + } + + req, err := client.CreateUpdateGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateGremlinDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateGremlinDatabasePreparer prepares the CreateUpdateGremlinDatabase request. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateGremlinDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateGremlinDatabaseSender sends the CreateUpdateGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateGremlinDatabaseResponder handles the response to the CreateUpdateGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateGremlinGraph create or update an Azure Cosmos DB Gremlin graph +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +// createUpdateGremlinGraphParameters - the parameters to provide for the current Gremlin graph. +func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (result GremlinResourcesCreateUpdateGremlinGraphFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.CreateUpdateGremlinGraph") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateGremlinGraphParameters, + Constraints: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, + {Target: "createUpdateGremlinGraphParameters.GremlinGraphCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", err.Error()) + } + + req, err := client.CreateUpdateGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateGremlinGraphSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "CreateUpdateGremlinGraph", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateGremlinGraphPreparer prepares the CreateUpdateGremlinGraph request. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithJSON(createUpdateGremlinGraphParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateGremlinGraphSender sends the CreateUpdateGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphSender(req *http.Request) (future GremlinResourcesCreateUpdateGremlinGraphFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateGremlinGraphResponder handles the response to the CreateUpdateGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) CreateUpdateGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesDeleteGremlinDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", err.Error()) + } + + req, err := client.DeleteGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteGremlinDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteGremlinDatabasePreparer prepares the DeleteGremlinDatabase request. +func (client GremlinResourcesClient) DeleteGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteGremlinDatabaseSender sends the DeleteGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) DeleteGremlinDatabaseSender(req *http.Request) (future GremlinResourcesDeleteGremlinDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteGremlinDatabaseResponder handles the response to the DeleteGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) DeleteGremlinDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteGremlinGraph deletes an existing Azure Cosmos DB Gremlin graph. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesDeleteGremlinGraphFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.DeleteGremlinGraph") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "DeleteGremlinGraph", err.Error()) + } + + req, err := client.DeleteGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", nil, "Failure preparing request") + return + } + + result, err = client.DeleteGremlinGraphSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "DeleteGremlinGraph", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteGremlinGraphPreparer prepares the DeleteGremlinGraph request. +func (client GremlinResourcesClient) DeleteGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteGremlinGraphSender sends the DeleteGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) DeleteGremlinGraphSender(req *http.Request) (future GremlinResourcesDeleteGremlinGraphFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteGremlinGraphResponder handles the response to the DeleteGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) DeleteGremlinGraphResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided +// name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabase", err.Error()) + } + + req, err := client.GetGremlinDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinDatabasePreparer prepares the GetGremlinDatabase request. +func (client GremlinResourcesClient) GetGremlinDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinDatabaseSender sends the GetGremlinDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinDatabaseResponder handles the response to the GetGremlinDatabase request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinDatabaseResponder(resp *http.Response) (result GremlinDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinDatabaseThroughput gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", err.Error()) + } + + req, err := client.GetGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinDatabaseThroughputPreparer prepares the GetGremlinDatabaseThroughput request. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinDatabaseThroughputSender sends the GetGremlinDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinDatabaseThroughputResponder handles the response to the GetGremlinDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinGraph gets the Gremlin graph under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinGraphGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraph") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraph", err.Error()) + } + + req, err := client.GetGremlinGraphPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinGraphSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinGraphResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraph", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinGraphPreparer prepares the GetGremlinGraph request. +func (client GremlinResourcesClient) GetGremlinGraphPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinGraphSender sends the GetGremlinGraph request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinGraphSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinGraphResponder handles the response to the GetGremlinGraph request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinGraphResponder(resp *http.Response) (result GremlinGraphGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGremlinGraphThroughput gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with +// the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.GetGremlinGraphThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", err.Error()) + } + + req, err := client.GetGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetGremlinGraphThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetGremlinGraphThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "GetGremlinGraphThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetGremlinGraphThroughputPreparer prepares the GetGremlinGraphThroughput request. +func (client GremlinResourcesClient) GetGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGremlinGraphThroughputSender sends the GetGremlinGraphThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) GetGremlinGraphThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetGremlinGraphThroughputResponder handles the response to the GetGremlinGraphThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) GetGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinDatabases", err.Error()) + } + + req, err := client.ListGremlinDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListGremlinDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListGremlinDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListGremlinDatabasesPreparer prepares the ListGremlinDatabases request. +func (client GremlinResourcesClient) ListGremlinDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGremlinDatabasesSender sends the ListGremlinDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) ListGremlinDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGremlinDatabasesResponder handles the response to the ListGremlinDatabases request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) ListGremlinDatabasesResponder(resp *http.Response) (result GremlinDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGremlinGraphs lists the Gremlin graph under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinGraphListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.ListGremlinGraphs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "ListGremlinGraphs", err.Error()) + } + + req, err := client.ListGremlinGraphsPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", nil, "Failure preparing request") + return + } + + resp, err := client.ListGremlinGraphsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure sending request") + return + } + + result, err = client.ListGremlinGraphsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "ListGremlinGraphs", resp, "Failure responding to request") + return + } + + return +} + +// ListGremlinGraphsPreparer prepares the ListGremlinGraphs request. +func (client GremlinResourcesClient) ListGremlinGraphsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGremlinGraphsSender sends the ListGremlinGraphs request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) ListGremlinGraphsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGremlinGraphsResponder handles the response to the ListGremlinGraphs request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) ListGremlinGraphsResponder(resp *http.Response) (result GremlinGraphListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinDatabaseToAutoscale migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateGremlinDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinDatabaseToAutoscalePreparer prepares the MigrateGremlinDatabaseToAutoscale request. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinDatabaseToAutoscaleSender sends the MigrateGremlinDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscaleSender(req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinDatabaseToAutoscaleResponder handles the response to the MigrateGremlinDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinDatabaseToManualThroughput migrate an Azure Cosmos DB Gremlin database from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateGremlinDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinDatabaseToManualThroughputPreparer prepares the MigrateGremlinDatabaseToManualThroughput request. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinDatabaseToManualThroughputSender sends the MigrateGremlinDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputSender(req *http.Request) (future GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinDatabaseToManualThroughputResponder handles the response to the MigrateGremlinDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinGraphToAutoscale migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinGraphToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", err.Error()) + } + + req, err := client.MigrateGremlinGraphToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinGraphToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinGraphToAutoscalePreparer prepares the MigrateGremlinGraphToAutoscale request. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinGraphToAutoscaleSender sends the MigrateGremlinGraphToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscaleSender(req *http.Request) (future GremlinResourcesMigrateGremlinGraphToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinGraphToAutoscaleResponder handles the response to the MigrateGremlinGraphToAutoscale request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinGraphToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateGremlinGraphToManualThroughput migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (result GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.MigrateGremlinGraphToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", err.Error()) + } + + req, err := client.MigrateGremlinGraphToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateGremlinGraphToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "MigrateGremlinGraphToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateGremlinGraphToManualThroughputPreparer prepares the MigrateGremlinGraphToManualThroughput request. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateGremlinGraphToManualThroughputSender sends the MigrateGremlinGraphToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputSender(req *http.Request) (future GremlinResourcesMigrateGremlinGraphToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateGremlinGraphToManualThroughputResponder handles the response to the MigrateGremlinGraphToManualThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) MigrateGremlinGraphToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateGremlinDatabaseThroughput update RUs per second of an Azure Cosmos DB Gremlin database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin +// database. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateGremlinDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateGremlinDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateGremlinDatabaseThroughputPreparer prepares the UpdateGremlinDatabaseThroughput request. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateGremlinDatabaseThroughputSender sends the UpdateGremlinDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateGremlinDatabaseThroughputResponder handles the response to the UpdateGremlinDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateGremlinGraphThroughput update RUs per second of an Azure Cosmos DB Gremlin graph +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// graphName - cosmos DB graph name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin graph. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GremlinResourcesClient.UpdateGremlinGraphThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", err.Error()) + } + + req, err := client.UpdateGremlinGraphThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateGremlinGraphThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesClient", "UpdateGremlinGraphThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateGremlinGraphThroughputPreparer prepares the UpdateGremlinGraphThroughput request. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "graphName": autorest.Encode("path", graphName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateGremlinGraphThroughputSender sends the UpdateGremlinGraphThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputSender(req *http.Request) (future GremlinResourcesUpdateGremlinGraphThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateGremlinGraphThroughputResponder handles the response to the UpdateGremlinGraphThroughput request. The method always +// closes the http.Response Body. +func (client GremlinResourcesClient) UpdateGremlinGraphThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/models.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/models.go new file mode 100644 index 000000000000..5a580f4d006c --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/models.go @@ -0,0 +1,13334 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb" + +// AnalyticalStorageConfiguration analytical storage specific properties. +type AnalyticalStorageConfiguration struct { + // SchemaType - Possible values include: 'WellDefined', 'FullFidelity' + SchemaType AnalyticalStorageSchemaType `json:"schemaType,omitempty"` +} + +// APIProperties ... +type APIProperties struct { + // ServerVersion - Describes the ServerVersion of an a MongoDB account. Possible values include: 'ThreeFullStopTwo', 'ThreeFullStopSix', 'FourFullStopZero' + ServerVersion ServerVersion `json:"serverVersion,omitempty"` +} + +// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other +// than required location and tags +type ARMProxyResource struct { + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ARMProxyResource. +func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ARMResourceProperties the core properties of ARM resources. +type ARMResourceProperties struct { + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ARMResourceProperties. +func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arp.Location != nil { + objectMap["location"] = arp.Location + } + if arp.Tags != nil { + objectMap["tags"] = arp.Tags + } + if arp.Identity != nil { + objectMap["identity"] = arp.Identity + } + return json.Marshal(objectMap) +} + +// AutoscaleSettings ... +type AutoscaleSettings struct { + // MaxThroughput - Represents maximum throughput, the resource can scale up to. + MaxThroughput *int32 `json:"maxThroughput,omitempty"` +} + +// AutoscaleSettingsResource cosmos DB provisioned throughput settings object +type AutoscaleSettingsResource struct { + // MaxThroughput - Represents maximum throughput container can scale up to. + MaxThroughput *int32 `json:"maxThroughput,omitempty"` + // AutoUpgradePolicy - Cosmos DB resource auto-upgrade policy + AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"` + // TargetMaxThroughput - READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state. + TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoscaleSettingsResource. +func (asr AutoscaleSettingsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.MaxThroughput != nil { + objectMap["maxThroughput"] = asr.MaxThroughput + } + if asr.AutoUpgradePolicy != nil { + objectMap["autoUpgradePolicy"] = asr.AutoUpgradePolicy + } + return json.Marshal(objectMap) +} + +// AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy +type AutoUpgradePolicyResource struct { + // ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade + ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BackupInformation backup information of a resource. +type BackupInformation struct { + autorest.Response `json:"-"` + // ContinuousBackupInformation - Information about the status of continuous backups. + ContinuousBackupInformation *ContinuousBackupInformation `json:"continuousBackupInformation,omitempty"` +} + +// BasicBackupPolicy the object representing the policy for taking backups on an account. +type BasicBackupPolicy interface { + AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) + AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) + AsBackupPolicy() (*BackupPolicy, bool) +} + +// BackupPolicy the object representing the policy for taking backups on an account. +type BackupPolicy struct { + // MigrationState - The object representing the state of the migration between the backup policies. + MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +func unmarshalBasicBackupPolicy(body []byte) (BasicBackupPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypePeriodic): + var pmbp PeriodicModeBackupPolicy + err := json.Unmarshal(body, &pmbp) + return pmbp, err + case string(TypeContinuous): + var cmbp ContinuousModeBackupPolicy + err := json.Unmarshal(body, &cmbp) + return cmbp, err + default: + var bp BackupPolicy + err := json.Unmarshal(body, &bp) + return bp, err + } +} +func unmarshalBasicBackupPolicyArray(body []byte) ([]BasicBackupPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + bpArray := make([]BasicBackupPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + bp, err := unmarshalBasicBackupPolicy(*rawMessage) + if err != nil { + return nil, err + } + bpArray[index] = bp + } + return bpArray, nil +} + +// MarshalJSON is the custom marshaler for BackupPolicy. +func (bp BackupPolicy) MarshalJSON() ([]byte, error) { + bp.Type = TypeBackupPolicy + objectMap := make(map[string]interface{}) + if bp.MigrationState != nil { + objectMap["migrationState"] = bp.MigrationState + } + if bp.Type != "" { + objectMap["type"] = bp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return nil, false +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return nil, false +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return &bp, true +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. +func (bp BackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &bp, true +} + +// BackupPolicyMigrationState the object representing the state of the migration between the backup +// policies. +type BackupPolicyMigrationState struct { + // Status - Describes the status of migration between backup policy types. Possible values include: 'Invalid', 'InProgress', 'Completed', 'Failed' + Status BackupPolicyMigrationStatus `json:"status,omitempty"` + // TargetType - Describes the target backup policy type of the backup policy migration. Possible values include: 'Periodic', 'Continuous' + TargetType BackupPolicyType `json:"targetType,omitempty"` + // StartTime - Time at which the backup policy migration started (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` +} + +// BackupResource a restorable backup of a Cassandra cluster. +type BackupResource struct { + autorest.Response `json:"-"` + Properties *BackupResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupResource. +func (br BackupResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if br.Properties != nil { + objectMap["properties"] = br.Properties + } + return json.Marshal(objectMap) +} + +// BackupResourceProperties ... +type BackupResourceProperties struct { + // Timestamp - The time this backup was taken, formatted like 2021-01-21T17:35:21 + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// Capability cosmos DB capability object +type Capability struct { + // Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". + Name *string `json:"name,omitempty"` +} + +// CassandraClustersCreateUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraClustersCreateUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraClustersClient) (ClusterResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraClustersCreateUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraClustersCreateUpdateFuture.Result. +func (future *CassandraClustersCreateUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersCreateUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.CreateUpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CassandraClustersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraClustersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraClustersDeleteFuture.Result. +func (future *CassandraClustersDeleteFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraClustersFetchNodeStatusFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraClustersFetchNodeStatusFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraClustersClient) (ClusterNodeStatus, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraClustersFetchNodeStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraClustersFetchNodeStatusFuture.Result. +func (future *CassandraClustersFetchNodeStatusFuture) result(client CassandraClustersClient) (cns ClusterNodeStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cns.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersFetchNodeStatusFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cns.Response.Response, err = future.GetResult(sender); err == nil && cns.Response.Response.StatusCode != http.StatusNoContent { + cns, err = client.FetchNodeStatusResponder(cns.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", cns.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraClustersRequestRepairFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraClustersRequestRepairFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraClustersRequestRepairFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraClustersRequestRepairFuture.Result. +func (future *CassandraClustersRequestRepairFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersRequestRepairFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersRequestRepairFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CassandraClustersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraClustersClient) (ClusterResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraClustersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraClustersUpdateFuture.Result. +func (future *CassandraClustersUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.UpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraDataCentersCreateUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraDataCentersCreateUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraDataCentersClient) (DataCenterResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraDataCentersCreateUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraDataCentersCreateUpdateFuture.Result. +func (future *CassandraDataCentersCreateUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersCreateUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent { + dcr, err = client.CreateUpdateResponder(dcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraDataCentersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraDataCentersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraDataCentersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraDataCentersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraDataCentersDeleteFuture.Result. +func (future *CassandraDataCentersDeleteFuture) result(client CassandraDataCentersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraDataCentersUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CassandraDataCentersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraDataCentersClient) (DataCenterResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraDataCentersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraDataCentersUpdateFuture.Result. +func (future *CassandraDataCentersUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent { + dcr, err = client.UpdateResponder(dcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace. +type CassandraKeyspaceCreateUpdateParameters struct { + // CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace. + *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters. +func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckcup.CassandraKeyspaceCreateUpdateProperties != nil { + objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties + } + if ckcup.Location != nil { + objectMap["location"] = ckcup.Location + } + if ckcup.Tags != nil { + objectMap["tags"] = ckcup.Tags + } + if ckcup.Identity != nil { + objectMap["identity"] = ckcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct. +func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties + err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties) + if err != nil { + return err + } + ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ckcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ckcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ckcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ckcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ckcup.Identity = &identity + } + } + } + + return nil +} + +// CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra +// keyspace. +type CassandraKeyspaceCreateUpdateProperties struct { + // Resource - The standard JSON format of a Cassandra keyspace + Resource *CassandraKeyspaceResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace +type CassandraKeyspaceGetProperties struct { + Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"` + Options *CassandraKeyspaceGetPropertiesOptions `json:"options,omitempty"` +} + +// CassandraKeyspaceGetPropertiesOptions ... +type CassandraKeyspaceGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// CassandraKeyspaceGetPropertiesResource ... +type CassandraKeyspaceGetPropertiesResource struct { + // ID - Name of the Cosmos DB Cassandra keyspace + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource. +func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckgp.ID != nil { + objectMap["id"] = ckgp.ID + } + return json.Marshal(objectMap) +} + +// CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace. +type CassandraKeyspaceGetResults struct { + autorest.Response `json:"-"` + // CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace + *CassandraKeyspaceGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults. +func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckgr.CassandraKeyspaceGetProperties != nil { + objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties + } + if ckgr.Location != nil { + objectMap["location"] = ckgr.Location + } + if ckgr.Tags != nil { + objectMap["tags"] = ckgr.Tags + } + if ckgr.Identity != nil { + objectMap["identity"] = ckgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct. +func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties + err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties) + if err != nil { + return err + } + ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ckgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ckgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ckgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ckgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ckgr.Identity = &identity + } + } + } + + return nil +} + +// CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their +// properties. +type CassandraKeyspaceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cassandra keyspaces and their properties. + Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraKeyspaceListResult. +func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object +type CassandraKeyspaceResource struct { + // ID - Name of the Cosmos DB Cassandra keyspace + ID *string `json:"id,omitempty"` +} + +// CassandraPartitionKey cosmos DB Cassandra table partition key +type CassandraPartitionKey struct { + // Name - Name of the Cosmos DB Cassandra table partition key + Name *string `json:"name,omitempty"` +} + +// CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesCreateUpdateCassandraKeyspaceFuture.Result. +func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ckgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent { + ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesCreateUpdateCassandraTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (CassandraTableGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesCreateUpdateCassandraTableFuture.Result. +func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ctgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent { + ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesCreateUpdateCassandraViewFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesCreateUpdateCassandraViewFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (CassandraViewGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesCreateUpdateCassandraViewFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesCreateUpdateCassandraViewFuture.Result. +func (future *CassandraResourcesCreateUpdateCassandraViewFuture) result(client CassandraResourcesClient) (cvgr CassandraViewGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraViewFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cvgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraViewFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cvgr.Response.Response, err = future.GetResult(sender); err == nil && cvgr.Response.Response.StatusCode != http.StatusNoContent { + cvgr, err = client.CreateUpdateCassandraViewResponder(cvgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraViewFuture", "Result", cvgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type CassandraResourcesDeleteCassandraKeyspaceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesDeleteCassandraKeyspaceFuture.Result. +func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type CassandraResourcesDeleteCassandraTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesDeleteCassandraTableFuture.Result. +func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraResourcesDeleteCassandraViewFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type CassandraResourcesDeleteCassandraViewFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesDeleteCassandraViewFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesDeleteCassandraViewFuture.Result. +func (future *CassandraResourcesDeleteCassandraViewFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraViewFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraViewFuture") + return + } + ar.Response = future.Response() + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture.Result. +func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture.Result. +func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraTableToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraTableToAutoscaleFuture.Result. +func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraTableToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraTableToManualThroughputFuture.Result. +func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraViewToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesMigrateCassandraViewToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraViewToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraViewToAutoscaleFuture.Result. +func (future *CassandraResourcesMigrateCassandraViewToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraViewToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraViewToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraViewToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraViewToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesMigrateCassandraViewToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type CassandraResourcesMigrateCassandraViewToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesMigrateCassandraViewToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesMigrateCassandraViewToManualThroughputFuture.Result. +func (future *CassandraResourcesMigrateCassandraViewToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraViewToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraViewToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateCassandraViewToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraViewToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesUpdateCassandraKeyspaceThroughputFuture.Result. +func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesUpdateCassandraTableThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesUpdateCassandraTableThroughputFuture.Result. +func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraResourcesUpdateCassandraViewThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type CassandraResourcesUpdateCassandraViewThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CassandraResourcesUpdateCassandraViewThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CassandraResourcesUpdateCassandraViewThroughputFuture.Result. +func (future *CassandraResourcesUpdateCassandraViewThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraViewThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraViewThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateCassandraViewThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraViewThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// CassandraSchema cosmos DB Cassandra table schema +type CassandraSchema struct { + // Columns - List of Cassandra table columns. + Columns *[]Column `json:"columns,omitempty"` + // PartitionKeys - List of partition key. + PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"` + // ClusterKeys - List of cluster key. + ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"` +} + +// CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table. +type CassandraTableCreateUpdateParameters struct { + // CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table. + *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters. +func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcup.CassandraTableCreateUpdateProperties != nil { + objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties + } + if ctcup.Location != nil { + objectMap["location"] = ctcup.Location + } + if ctcup.Tags != nil { + objectMap["tags"] = ctcup.Tags + } + if ctcup.Identity != nil { + objectMap["identity"] = ctcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct. +func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties + err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties) + if err != nil { + return err + } + ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ctcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ctcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ctcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ctcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ctcup.Identity = &identity + } + } + } + + return nil +} + +// CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table. +type CassandraTableCreateUpdateProperties struct { + // Resource - The standard JSON format of a Cassandra table + Resource *CassandraTableResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table +type CassandraTableGetProperties struct { + Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"` + Options *CassandraTableGetPropertiesOptions `json:"options,omitempty"` +} + +// CassandraTableGetPropertiesOptions ... +type CassandraTableGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// CassandraTableGetPropertiesResource ... +type CassandraTableGetPropertiesResource struct { + // ID - Name of the Cosmos DB Cassandra table + ID *string `json:"id,omitempty"` + // DefaultTTL - Time to live of the Cosmos DB Cassandra table + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // Schema - Schema of the Cosmos DB Cassandra table + Schema *CassandraSchema `json:"schema,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource. +func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctgp.ID != nil { + objectMap["id"] = ctgp.ID + } + if ctgp.DefaultTTL != nil { + objectMap["defaultTtl"] = ctgp.DefaultTTL + } + if ctgp.Schema != nil { + objectMap["schema"] = ctgp.Schema + } + if ctgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = ctgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// CassandraTableGetResults an Azure Cosmos DB Cassandra table. +type CassandraTableGetResults struct { + autorest.Response `json:"-"` + // CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table + *CassandraTableGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableGetResults. +func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctgr.CassandraTableGetProperties != nil { + objectMap["properties"] = ctgr.CassandraTableGetProperties + } + if ctgr.Location != nil { + objectMap["location"] = ctgr.Location + } + if ctgr.Tags != nil { + objectMap["tags"] = ctgr.Tags + } + if ctgr.Identity != nil { + objectMap["identity"] = ctgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct. +func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraTableGetProperties CassandraTableGetProperties + err = json.Unmarshal(*v, &cassandraTableGetProperties) + if err != nil { + return err + } + ctgr.CassandraTableGetProperties = &cassandraTableGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ctgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ctgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ctgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ctgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ctgr.Identity = &identity + } + } + } + + return nil +} + +// CassandraTableListResult the List operation response, that contains the Cassandra tables and their +// properties. +type CassandraTableListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cassandra tables and their properties. + Value *[]CassandraTableGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableListResult. +func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CassandraTableResource cosmos DB Cassandra table resource object +type CassandraTableResource struct { + // ID - Name of the Cosmos DB Cassandra table + ID *string `json:"id,omitempty"` + // DefaultTTL - Time to live of the Cosmos DB Cassandra table + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // Schema - Schema of the Cosmos DB Cassandra table + Schema *CassandraSchema `json:"schema,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` +} + +// CassandraViewCreateUpdateParameters parameters to create and update Cosmos DB Cassandra view. +type CassandraViewCreateUpdateParameters struct { + // CassandraViewCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra view. + *CassandraViewCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraViewCreateUpdateParameters. +func (cvcup CassandraViewCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cvcup.CassandraViewCreateUpdateProperties != nil { + objectMap["properties"] = cvcup.CassandraViewCreateUpdateProperties + } + if cvcup.Location != nil { + objectMap["location"] = cvcup.Location + } + if cvcup.Tags != nil { + objectMap["tags"] = cvcup.Tags + } + if cvcup.Identity != nil { + objectMap["identity"] = cvcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraViewCreateUpdateParameters struct. +func (cvcup *CassandraViewCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraViewCreateUpdateProperties CassandraViewCreateUpdateProperties + err = json.Unmarshal(*v, &cassandraViewCreateUpdateProperties) + if err != nil { + return err + } + cvcup.CassandraViewCreateUpdateProperties = &cassandraViewCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cvcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cvcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cvcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cvcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cvcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cvcup.Identity = &identity + } + } + } + + return nil +} + +// CassandraViewCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra view. +type CassandraViewCreateUpdateProperties struct { + // Resource - The standard JSON format of a Cassandra view + Resource *CassandraViewResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraViewGetProperties the properties of an Azure Cosmos DB Cassandra view +type CassandraViewGetProperties struct { + Resource *CassandraViewGetPropertiesResource `json:"resource,omitempty"` + Options *CassandraViewGetPropertiesOptions `json:"options,omitempty"` +} + +// CassandraViewGetPropertiesOptions ... +type CassandraViewGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// CassandraViewGetPropertiesResource ... +type CassandraViewGetPropertiesResource struct { + // ID - Name of the Cosmos DB Cassandra view + ID *string `json:"id,omitempty"` + // ViewDefinition - View Definition of the Cosmos DB Cassandra view + ViewDefinition *string `json:"viewDefinition,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraViewGetPropertiesResource. +func (cvgp CassandraViewGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cvgp.ID != nil { + objectMap["id"] = cvgp.ID + } + if cvgp.ViewDefinition != nil { + objectMap["viewDefinition"] = cvgp.ViewDefinition + } + return json.Marshal(objectMap) +} + +// CassandraViewGetResults an Azure Cosmos DB Cassandra view. +type CassandraViewGetResults struct { + autorest.Response `json:"-"` + // CassandraViewGetProperties - The properties of an Azure Cosmos DB Cassandra view + *CassandraViewGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraViewGetResults. +func (cvgr CassandraViewGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cvgr.CassandraViewGetProperties != nil { + objectMap["properties"] = cvgr.CassandraViewGetProperties + } + if cvgr.Location != nil { + objectMap["location"] = cvgr.Location + } + if cvgr.Tags != nil { + objectMap["tags"] = cvgr.Tags + } + if cvgr.Identity != nil { + objectMap["identity"] = cvgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CassandraViewGetResults struct. +func (cvgr *CassandraViewGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var cassandraViewGetProperties CassandraViewGetProperties + err = json.Unmarshal(*v, &cassandraViewGetProperties) + if err != nil { + return err + } + cvgr.CassandraViewGetProperties = &cassandraViewGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cvgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cvgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cvgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cvgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cvgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cvgr.Identity = &identity + } + } + } + + return nil +} + +// CassandraViewListResult the List operation response, that contains the Cassandra views and their +// properties. +type CassandraViewListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cassandra views and their properties. + Value *[]CassandraViewGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraViewListResult. +func (cvlr CassandraViewListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CassandraViewResource cosmos DB Cassandra view resource object +type CassandraViewResource struct { + // ID - Name of the Cosmos DB Cassandra view + ID *string `json:"id,omitempty"` + // ViewDefinition - View Definition of the Cosmos DB Cassandra view + ViewDefinition *string `json:"viewDefinition,omitempty"` +} + +// Certificate ... +type Certificate struct { + // Pem - PEM formatted public key. + Pem *string `json:"pem,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + Error *ErrorResponse `json:"error,omitempty"` +} + +// ClusterKey cosmos DB Cassandra table cluster key +type ClusterKey struct { + // Name - Name of the Cosmos DB Cassandra table cluster key + Name *string `json:"name,omitempty"` + // OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" + OrderBy *string `json:"orderBy,omitempty"` +} + +// ClusterNodeStatus the status of all nodes in the cluster (as returned by 'nodetool status'). +type ClusterNodeStatus struct { + autorest.Response `json:"-"` + // Nodes - Information about nodes in the cluster (corresponds to what is returned from nodetool info). + Nodes *[]ClusterNodeStatusNodesItem `json:"nodes,omitempty"` +} + +// ClusterNodeStatusNodesItem ... +type ClusterNodeStatusNodesItem struct { + // Datacenter - The Cassandra data center this node resides in. + Datacenter *string `json:"datacenter,omitempty"` + // Status - Indicates whether the node is functioning or not. Possible values include: 'Up', 'Down' + Status NodeStatus `json:"status,omitempty"` + // State - The state of the node in relation to the cluster. Possible values include: 'Normal', 'Leaving', 'Joining', 'Moving', 'Stopped' + State NodeState `json:"state,omitempty"` + // Address - The node's URL. + Address *string `json:"address,omitempty"` + // Load - The amount of file system data in the data directory (e.g., 47.66 KB), excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up (such as TTL-expired cell or tombstoned data) is counted. + Load *string `json:"load,omitempty"` + // Tokens - List of tokens. + Tokens *[]string `json:"tokens,omitempty"` + // Owns - The percentage of the data owned by the node per datacenter times the replication factor (e.g., 33.3, or null if the data is not available). For example, a node can own 33% of the ring, but shows 100% if the replication factor is 3. For non-system keyspaces, the endpoint percentage ownership information is shown. + Owns *float64 `json:"owns,omitempty"` + // HostID - The network ID of the node. + HostID *string `json:"hostId,omitempty"` + // Rack - The rack this node is part of. + Rack *string `json:"rack,omitempty"` +} + +// ClusterResource representation of a managed Cassandra cluster. +type ClusterResource struct { + autorest.Response `json:"-"` + // Properties - Properties of a managed Cassandra cluster. + Properties *ClusterResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterResource. +func (cr ClusterResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.Properties != nil { + objectMap["properties"] = cr.Properties + } + if cr.Location != nil { + objectMap["location"] = cr.Location + } + if cr.Tags != nil { + objectMap["tags"] = cr.Tags + } + if cr.Identity != nil { + objectMap["identity"] = cr.Identity + } + return json.Marshal(objectMap) +} + +// ClusterResourceProperties properties of a managed Cassandra cluster. +type ClusterResourceProperties struct { + // ProvisioningState - Possible values include: 'ManagedCassandraProvisioningStateCreating', 'ManagedCassandraProvisioningStateUpdating', 'ManagedCassandraProvisioningStateDeleting', 'ManagedCassandraProvisioningStateSucceeded', 'ManagedCassandraProvisioningStateFailed', 'ManagedCassandraProvisioningStateCanceled' + ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` + // RestoreFromBackupID - To create an empty cluster, omit this field or set it to null. To restore a backup into a new cluster, set this field to the resource id of the backup. + RestoreFromBackupID *string `json:"restoreFromBackupId,omitempty"` + // DelegatedManagementSubnetID - Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form '/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/' + DelegatedManagementSubnetID *string `json:"delegatedManagementSubnetId,omitempty"` + // CassandraVersion - Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. + CassandraVersion *string `json:"cassandraVersion,omitempty"` + // ClusterNameOverride - If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property. + ClusterNameOverride *string `json:"clusterNameOverride,omitempty"` + // AuthenticationMethod - Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Possible values include: 'AuthenticationMethodNone', 'AuthenticationMethodCassandra' + AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` + // InitialCassandraAdminPassword - Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. + InitialCassandraAdminPassword *string `json:"initialCassandraAdminPassword,omitempty"` + // HoursBetweenBackups - Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. + HoursBetweenBackups *int32 `json:"hoursBetweenBackups,omitempty"` + // PrometheusEndpoint - Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. + PrometheusEndpoint *SeedNode `json:"prometheusEndpoint,omitempty"` + // RepairEnabled - Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. + RepairEnabled *bool `json:"repairEnabled,omitempty"` + // ClientCertificates - List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. + ClientCertificates *[]Certificate `json:"clientCertificates,omitempty"` + // ExternalGossipCertificates - List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. + ExternalGossipCertificates *[]Certificate `json:"externalGossipCertificates,omitempty"` + // GossipCertificates - READ-ONLY; List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. + GossipCertificates *[]Certificate `json:"gossipCertificates,omitempty"` + // ExternalSeedNodes - List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. + ExternalSeedNodes *[]SeedNode `json:"externalSeedNodes,omitempty"` + // SeedNodes - READ-ONLY; List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. + SeedNodes *[]SeedNode `json:"seedNodes,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterResourceProperties. +func (cr ClusterResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.ProvisioningState != "" { + objectMap["provisioningState"] = cr.ProvisioningState + } + if cr.RestoreFromBackupID != nil { + objectMap["restoreFromBackupId"] = cr.RestoreFromBackupID + } + if cr.DelegatedManagementSubnetID != nil { + objectMap["delegatedManagementSubnetId"] = cr.DelegatedManagementSubnetID + } + if cr.CassandraVersion != nil { + objectMap["cassandraVersion"] = cr.CassandraVersion + } + if cr.ClusterNameOverride != nil { + objectMap["clusterNameOverride"] = cr.ClusterNameOverride + } + if cr.AuthenticationMethod != "" { + objectMap["authenticationMethod"] = cr.AuthenticationMethod + } + if cr.InitialCassandraAdminPassword != nil { + objectMap["initialCassandraAdminPassword"] = cr.InitialCassandraAdminPassword + } + if cr.HoursBetweenBackups != nil { + objectMap["hoursBetweenBackups"] = cr.HoursBetweenBackups + } + if cr.PrometheusEndpoint != nil { + objectMap["prometheusEndpoint"] = cr.PrometheusEndpoint + } + if cr.RepairEnabled != nil { + objectMap["repairEnabled"] = cr.RepairEnabled + } + if cr.ClientCertificates != nil { + objectMap["clientCertificates"] = cr.ClientCertificates + } + if cr.ExternalGossipCertificates != nil { + objectMap["externalGossipCertificates"] = cr.ExternalGossipCertificates + } + if cr.ExternalSeedNodes != nil { + objectMap["externalSeedNodes"] = cr.ExternalSeedNodes + } + return json.Marshal(objectMap) +} + +// Column cosmos DB Cassandra table column +type Column struct { + // Name - Name of the Cosmos DB Cassandra table column + Name *string `json:"name,omitempty"` + // Type - Type of the Cosmos DB Cassandra table column + Type *string `json:"type,omitempty"` +} + +// CompositePath ... +type CompositePath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Order - Sort order for composite paths. Possible values include: 'Ascending', 'Descending' + Order CompositePathSortOrder `json:"order,omitempty"` +} + +// ConflictResolutionPolicy the conflict resolution policy for the container. +type ConflictResolutionPolicy struct { + // Mode - Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom' + Mode ConflictResolutionMode `json:"mode,omitempty"` + // ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode. + ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"` + // ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode. + ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"` +} + +// ConsistencyPolicy the consistency policy for the Cosmos DB database account. +type ConsistencyPolicy struct { + // DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' + DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"` + // MaxStalenessPrefix - When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"` + // MaxIntervalInSeconds - When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"` +} + +// ContainerPartitionKey the configuration of the partition key to be used for partitioning data into +// multiple partitions +type ContainerPartitionKey struct { + // Paths - List of paths using which data within the container can be partitioned + Paths *[]string `json:"paths,omitempty"` + // Kind - Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. Possible values include: 'PartitionKindHash', 'PartitionKindRange', 'PartitionKindMultiHash' + Kind PartitionKind `json:"kind,omitempty"` + // Version - Indicates the version of the partition key definition + Version *int32 `json:"version,omitempty"` + // SystemKey - READ-ONLY; Indicates if the container is using a system generated partition key + SystemKey *bool `json:"systemKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerPartitionKey. +func (cpk ContainerPartitionKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpk.Paths != nil { + objectMap["paths"] = cpk.Paths + } + if cpk.Kind != "" { + objectMap["kind"] = cpk.Kind + } + if cpk.Version != nil { + objectMap["version"] = cpk.Version + } + return json.Marshal(objectMap) +} + +// ContinuousBackupInformation information about the status of continuous backups. +type ContinuousBackupInformation struct { + // LatestRestorableTimestamp - The latest restorable timestamp for a resource. + LatestRestorableTimestamp *string `json:"latestRestorableTimestamp,omitempty"` +} + +// ContinuousBackupRestoreLocation properties of the regional restorable account. +type ContinuousBackupRestoreLocation struct { + // Location - The name of the continuous backup restore location. + Location *string `json:"location,omitempty"` +} + +// ContinuousModeBackupPolicy the object representing continuous mode backup policy. +type ContinuousModeBackupPolicy struct { + // MigrationState - The object representing the state of the migration between the backup policies. + MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { + cmbp.Type = TypeContinuous + objectMap := make(map[string]interface{}) + if cmbp.MigrationState != nil { + objectMap["migrationState"] = cmbp.MigrationState + } + if cmbp.Type != "" { + objectMap["type"] = cmbp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return nil, false +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return &cmbp, true +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return nil, false +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. +func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &cmbp, true +} + +// CorsPolicy the CORS policy for the Cosmos DB database account. +type CorsPolicy struct { + // AllowedOrigins - The origin domains that are permitted to make a request against the service via CORS. + AllowedOrigins *string `json:"allowedOrigins,omitempty"` + // AllowedMethods - The methods (HTTP request verbs) that the origin domain may use for a CORS request. + AllowedMethods *string `json:"allowedMethods,omitempty"` + // AllowedHeaders - The request headers that the origin domain may specify on the CORS request. + AllowedHeaders *string `json:"allowedHeaders,omitempty"` + // ExposedHeaders - The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + ExposedHeaders *string `json:"exposedHeaders,omitempty"` + // MaxAgeInSeconds - The maximum amount time that a browser should cache the preflight OPTIONS request. + MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` +} + +// CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource. +// Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" +type CreateUpdateOptions struct { + // Throughput - Request Units per second. For example, "throughput": 10000. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// DatabaseAccountConnectionString connection string for the Cosmos DB account +type DatabaseAccountConnectionString struct { + // ConnectionString - READ-ONLY; Value of the connection string + ConnectionString *string `json:"connectionString,omitempty"` + // Description - READ-ONLY; Description of the connection string + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountConnectionString. +func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts. +type DatabaseAccountCreateUpdateParameters struct { + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'DatabaseAccountKindGlobalDocumentDB', 'DatabaseAccountKindMongoDB', 'DatabaseAccountKindParse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters. +func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dacup.Kind != "" { + objectMap["kind"] = dacup.Kind + } + if dacup.DatabaseAccountCreateUpdateProperties != nil { + objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties + } + if dacup.Location != nil { + objectMap["location"] = dacup.Location + } + if dacup.Tags != nil { + objectMap["tags"] = dacup.Tags + } + if dacup.Identity != nil { + objectMap["identity"] = dacup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. +func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dacup.Kind = kind + } + case "properties": + if v != nil { + var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties + err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties) + if err != nil { + return err + } + dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dacup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dacup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dacup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dacup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dacup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + dacup.Identity = &identity + } + } + } + + return nil +} + +// DatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts. +type DatabaseAccountCreateUpdateProperties struct { + // ConsistencyPolicy - The consistency policy for the Cosmos DB account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // DatabaseAccountOfferType - The offer type for the database + DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. Currently, supported only for MongoDB API. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // AnalyticalStorageConfiguration - Analytical storage specific properties. + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + // CreateMode - Enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' + CreateMode CreateMode `json:"createMode,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + // DiagnosticLogSettings - The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + // RestoreParameters - Parameters to indicate the information about the restore. + RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateProperties struct. +func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + dacup.ConsistencyPolicy = &consistencyPolicy + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + dacup.Locations = &locations + } + case "databaseAccountOfferType": + if v != nil { + var databaseAccountOfferType string + err = json.Unmarshal(*v, &databaseAccountOfferType) + if err != nil { + return err + } + dacup.DatabaseAccountOfferType = &databaseAccountOfferType + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + dacup.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + dacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + dacup.EnableAutomaticFailover = &enableAutomaticFailover + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + dacup.Capabilities = &capabilities + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + dacup.VirtualNetworkRules = &virtualNetworkRules + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + dacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + dacup.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + dacup.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + dacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + dacup.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + dacup.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + dacup.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + dacup.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + dacup.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + dacup.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "analyticalStorageConfiguration": + if v != nil { + var analyticalStorageConfiguration AnalyticalStorageConfiguration + err = json.Unmarshal(*v, &analyticalStorageConfiguration) + if err != nil { + return err + } + dacup.AnalyticalStorageConfiguration = &analyticalStorageConfiguration + } + case "createMode": + if v != nil { + var createMode CreateMode + err = json.Unmarshal(*v, &createMode) + if err != nil { + return err + } + dacup.CreateMode = createMode + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + dacup.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dacup.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + dacup.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + dacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + case "diagnosticLogSettings": + if v != nil { + var diagnosticLogSettings DiagnosticLogSettings + err = json.Unmarshal(*v, &diagnosticLogSettings) + if err != nil { + return err + } + dacup.DiagnosticLogSettings = &diagnosticLogSettings + } + case "disableLocalAuth": + if v != nil { + var disableLocalAuth bool + err = json.Unmarshal(*v, &disableLocalAuth) + if err != nil { + return err + } + dacup.DisableLocalAuth = &disableLocalAuth + } + case "restoreParameters": + if v != nil { + var restoreParameters RestoreParameters + err = json.Unmarshal(*v, &restoreParameters) + if err != nil { + return err + } + dacup.RestoreParameters = &restoreParameters + } + } + } + + return nil +} + +// DatabaseAccountGetProperties properties for the database account. +type DatabaseAccountGetProperties struct { + ProvisioningState *string `json:"provisioningState,omitempty"` + // DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account. + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + // DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard' + DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account. + WriteLocations *[]Location `json:"writeLocations,omitempty"` + // ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account. + ReadLocations *[]Location `json:"readLocations,omitempty"` + // Locations - READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities. + FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // AnalyticalStorageConfiguration - Analytical storage specific properties. + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + // InstanceID - READ-ONLY; A unique identifier assigned to the database account + InstanceID *string `json:"instanceId,omitempty"` + // CreateMode - Enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' + CreateMode CreateMode `json:"createMode,omitempty"` + // RestoreParameters - Parameters to indicate the information about the restore. + RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + // DiagnosticLogSettings - The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountGetProperties. +func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dagp.ProvisioningState != nil { + objectMap["provisioningState"] = dagp.ProvisioningState + } + if dagp.IPRules != nil { + objectMap["ipRules"] = dagp.IPRules + } + if dagp.IsVirtualNetworkFilterEnabled != nil { + objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled + } + if dagp.EnableAutomaticFailover != nil { + objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover + } + if dagp.ConsistencyPolicy != nil { + objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy + } + if dagp.Capabilities != nil { + objectMap["capabilities"] = dagp.Capabilities + } + if dagp.VirtualNetworkRules != nil { + objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules + } + if dagp.EnableMultipleWriteLocations != nil { + objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations + } + if dagp.EnableCassandraConnector != nil { + objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector + } + if dagp.ConnectorOffer != "" { + objectMap["connectorOffer"] = dagp.ConnectorOffer + } + if dagp.DisableKeyBasedMetadataWriteAccess != nil { + objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess + } + if dagp.KeyVaultKeyURI != nil { + objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI + } + if dagp.DefaultIdentity != nil { + objectMap["defaultIdentity"] = dagp.DefaultIdentity + } + if dagp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess + } + if dagp.EnableFreeTier != nil { + objectMap["enableFreeTier"] = dagp.EnableFreeTier + } + if dagp.APIProperties != nil { + objectMap["apiProperties"] = dagp.APIProperties + } + if dagp.EnableAnalyticalStorage != nil { + objectMap["enableAnalyticalStorage"] = dagp.EnableAnalyticalStorage + } + if dagp.AnalyticalStorageConfiguration != nil { + objectMap["analyticalStorageConfiguration"] = dagp.AnalyticalStorageConfiguration + } + if dagp.CreateMode != "" { + objectMap["createMode"] = dagp.CreateMode + } + if dagp.RestoreParameters != nil { + objectMap["restoreParameters"] = dagp.RestoreParameters + } + objectMap["backupPolicy"] = dagp.BackupPolicy + if dagp.Cors != nil { + objectMap["cors"] = dagp.Cors + } + if dagp.NetworkACLBypass != "" { + objectMap["networkAclBypass"] = dagp.NetworkACLBypass + } + if dagp.NetworkACLBypassResourceIds != nil { + objectMap["networkAclBypassResourceIds"] = dagp.NetworkACLBypassResourceIds + } + if dagp.DiagnosticLogSettings != nil { + objectMap["diagnosticLogSettings"] = dagp.DiagnosticLogSettings + } + if dagp.DisableLocalAuth != nil { + objectMap["disableLocalAuth"] = dagp.DisableLocalAuth + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetProperties struct. +func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState string + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + dagp.ProvisioningState = &provisioningState + } + case "documentEndpoint": + if v != nil { + var documentEndpoint string + err = json.Unmarshal(*v, &documentEndpoint) + if err != nil { + return err + } + dagp.DocumentEndpoint = &documentEndpoint + } + case "databaseAccountOfferType": + if v != nil { + var databaseAccountOfferType DatabaseAccountOfferType + err = json.Unmarshal(*v, &databaseAccountOfferType) + if err != nil { + return err + } + dagp.DatabaseAccountOfferType = databaseAccountOfferType + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + dagp.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + dagp.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + dagp.EnableAutomaticFailover = &enableAutomaticFailover + } + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + dagp.ConsistencyPolicy = &consistencyPolicy + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + dagp.Capabilities = &capabilities + } + case "writeLocations": + if v != nil { + var writeLocations []Location + err = json.Unmarshal(*v, &writeLocations) + if err != nil { + return err + } + dagp.WriteLocations = &writeLocations + } + case "readLocations": + if v != nil { + var readLocations []Location + err = json.Unmarshal(*v, &readLocations) + if err != nil { + return err + } + dagp.ReadLocations = &readLocations + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + dagp.Locations = &locations + } + case "failoverPolicies": + if v != nil { + var failoverPolicies []FailoverPolicy + err = json.Unmarshal(*v, &failoverPolicies) + if err != nil { + return err + } + dagp.FailoverPolicies = &failoverPolicies + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + dagp.VirtualNetworkRules = &virtualNetworkRules + } + case "privateEndpointConnections": + if v != nil { + var privateEndpointConnections []PrivateEndpointConnection + err = json.Unmarshal(*v, &privateEndpointConnections) + if err != nil { + return err + } + dagp.PrivateEndpointConnections = &privateEndpointConnections + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + dagp.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + dagp.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + dagp.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + dagp.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + dagp.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + dagp.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + dagp.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + dagp.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + dagp.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + dagp.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "analyticalStorageConfiguration": + if v != nil { + var analyticalStorageConfiguration AnalyticalStorageConfiguration + err = json.Unmarshal(*v, &analyticalStorageConfiguration) + if err != nil { + return err + } + dagp.AnalyticalStorageConfiguration = &analyticalStorageConfiguration + } + case "instanceId": + if v != nil { + var instanceID string + err = json.Unmarshal(*v, &instanceID) + if err != nil { + return err + } + dagp.InstanceID = &instanceID + } + case "createMode": + if v != nil { + var createMode CreateMode + err = json.Unmarshal(*v, &createMode) + if err != nil { + return err + } + dagp.CreateMode = createMode + } + case "restoreParameters": + if v != nil { + var restoreParameters RestoreParameters + err = json.Unmarshal(*v, &restoreParameters) + if err != nil { + return err + } + dagp.RestoreParameters = &restoreParameters + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + dagp.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dagp.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + dagp.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + dagp.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + case "diagnosticLogSettings": + if v != nil { + var diagnosticLogSettings DiagnosticLogSettings + err = json.Unmarshal(*v, &diagnosticLogSettings) + if err != nil { + return err + } + dagp.DiagnosticLogSettings = &diagnosticLogSettings + } + case "disableLocalAuth": + if v != nil { + var disableLocalAuth bool + err = json.Unmarshal(*v, &disableLocalAuth) + if err != nil { + return err + } + dagp.DisableLocalAuth = &disableLocalAuth + } + } + } + + return nil +} + +// DatabaseAccountGetResults an Azure Cosmos DB database account. +type DatabaseAccountGetResults struct { + autorest.Response `json:"-"` + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'DatabaseAccountKindGlobalDocumentDB', 'DatabaseAccountKindMongoDB', 'DatabaseAccountKindParse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + *DatabaseAccountGetProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountGetResults. +func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dagr.Kind != "" { + objectMap["kind"] = dagr.Kind + } + if dagr.DatabaseAccountGetProperties != nil { + objectMap["properties"] = dagr.DatabaseAccountGetProperties + } + if dagr.Location != nil { + objectMap["location"] = dagr.Location + } + if dagr.Tags != nil { + objectMap["tags"] = dagr.Tags + } + if dagr.Identity != nil { + objectMap["identity"] = dagr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetResults struct. +func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dagr.Kind = kind + } + case "properties": + if v != nil { + var databaseAccountGetProperties DatabaseAccountGetProperties + err = json.Unmarshal(*v, &databaseAccountGetProperties) + if err != nil { + return err + } + dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + dagr.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dagr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dagr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dagr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dagr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dagr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + dagr.Identity = &identity + } + } + } + + return nil +} + +// DatabaseAccountListConnectionStringsResult the connection strings for the given database account. +type DatabaseAccountListConnectionStringsResult struct { + autorest.Response `json:"-"` + // ConnectionStrings - An array that contains the connection strings for the Cosmos DB account. + ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"` +} + +// DatabaseAccountListKeysResult the access keys for the given database account. +type DatabaseAccountListKeysResult struct { + autorest.Response `json:"-"` + // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. + PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` + // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. + SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. +func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. +type DatabaseAccountListReadOnlyKeysResult struct { + autorest.Response `json:"-"` + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountListReadOnlyKeysResult. +func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account. +type DatabaseAccountRegenerateKeyParameters struct { + // KeyKind - The access key to regenerate. Possible values include: 'Primary', 'Secondary', 'PrimaryReadonly', 'SecondaryReadonly' + KeyKind KeyKind `json:"keyKind,omitempty"` +} + +// DatabaseAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsCreateOrUpdateFuture.Result. +func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dagr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { + dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabaseAccountsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsDeleteFuture.Result. +func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsFailoverPriorityChangeFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type DatabaseAccountsFailoverPriorityChangeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsFailoverPriorityChangeFuture.Result. +func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsListResult the List operation response, that contains the database accounts and their +// properties. +type DatabaseAccountsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of database account and their properties. + Value *[]DatabaseAccountGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountsListResult. +func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DatabaseAccountsOfflineRegionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsOfflineRegionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsOfflineRegionFuture.Result. +func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsOnlineRegionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsOnlineRegionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsOnlineRegionFuture.Result. +func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsRegenerateKeyFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabaseAccountsRegenerateKeyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsRegenerateKeyFuture.Result. +func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseAccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabaseAccountsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DatabaseAccountsUpdateFuture.Result. +func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dagr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { + dagr, err = client.UpdateResponder(dagr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabaseAccountUpdateParameters parameters for patching Azure Cosmos DB database account properties. +type DatabaseAccountUpdateParameters struct { + Tags map[string]*string `json:"tags"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + *DatabaseAccountUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters. +func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if daup.Tags != nil { + objectMap["tags"] = daup.Tags + } + if daup.Location != nil { + objectMap["location"] = daup.Location + } + if daup.Identity != nil { + objectMap["identity"] = daup.Identity + } + if daup.DatabaseAccountUpdateProperties != nil { + objectMap["properties"] = daup.DatabaseAccountUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateParameters struct. +func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + daup.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + daup.Location = &location + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + daup.Identity = &identity + } + case "properties": + if v != nil { + var databaseAccountUpdateProperties DatabaseAccountUpdateProperties + err = json.Unmarshal(*v, &databaseAccountUpdateProperties) + if err != nil { + return err + } + daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties + } + } + } + + return nil +} + +// DatabaseAccountUpdateProperties properties to update Azure Cosmos DB database accounts. +type DatabaseAccountUpdateProperties struct { + // ConsistencyPolicy - The consistency policy for the Cosmos DB account. + ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. + Locations *[]Location `json:"locations,omitempty"` + // IPRules - List of IpRules. + IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` + // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. + IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` + // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` + // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // EnableMultipleWriteLocations - Enables the account to write in multiple locations + EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` + // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys + DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` + // KeyVaultKeyURI - The URI of the key vault + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` + // DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EnableFreeTier - Flag to indicate whether Free Tier is enabled. + EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // APIProperties - API specific properties. Currently, supported only for MongoDB API. + APIProperties *APIProperties `json:"apiProperties,omitempty"` + // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. + EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` + // AnalyticalStorageConfiguration - Analytical storage specific properties. + AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"` + // BackupPolicy - The object representing the policy for taking backups on an account. + BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' + NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` + // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` + // DiagnosticLogSettings - The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateProperties struct. +func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "consistencyPolicy": + if v != nil { + var consistencyPolicy ConsistencyPolicy + err = json.Unmarshal(*v, &consistencyPolicy) + if err != nil { + return err + } + daup.ConsistencyPolicy = &consistencyPolicy + } + case "locations": + if v != nil { + var locations []Location + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + daup.Locations = &locations + } + case "ipRules": + if v != nil { + var IPRules []IPAddressOrRange + err = json.Unmarshal(*v, &IPRules) + if err != nil { + return err + } + daup.IPRules = &IPRules + } + case "isVirtualNetworkFilterEnabled": + if v != nil { + var isVirtualNetworkFilterEnabled bool + err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) + if err != nil { + return err + } + daup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled + } + case "enableAutomaticFailover": + if v != nil { + var enableAutomaticFailover bool + err = json.Unmarshal(*v, &enableAutomaticFailover) + if err != nil { + return err + } + daup.EnableAutomaticFailover = &enableAutomaticFailover + } + case "capabilities": + if v != nil { + var capabilities []Capability + err = json.Unmarshal(*v, &capabilities) + if err != nil { + return err + } + daup.Capabilities = &capabilities + } + case "virtualNetworkRules": + if v != nil { + var virtualNetworkRules []VirtualNetworkRule + err = json.Unmarshal(*v, &virtualNetworkRules) + if err != nil { + return err + } + daup.VirtualNetworkRules = &virtualNetworkRules + } + case "enableMultipleWriteLocations": + if v != nil { + var enableMultipleWriteLocations bool + err = json.Unmarshal(*v, &enableMultipleWriteLocations) + if err != nil { + return err + } + daup.EnableMultipleWriteLocations = &enableMultipleWriteLocations + } + case "enableCassandraConnector": + if v != nil { + var enableCassandraConnector bool + err = json.Unmarshal(*v, &enableCassandraConnector) + if err != nil { + return err + } + daup.EnableCassandraConnector = &enableCassandraConnector + } + case "connectorOffer": + if v != nil { + var connectorOffer ConnectorOffer + err = json.Unmarshal(*v, &connectorOffer) + if err != nil { + return err + } + daup.ConnectorOffer = connectorOffer + } + case "disableKeyBasedMetadataWriteAccess": + if v != nil { + var disableKeyBasedMetadataWriteAccess bool + err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) + if err != nil { + return err + } + daup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess + } + case "keyVaultKeyUri": + if v != nil { + var keyVaultKeyURI string + err = json.Unmarshal(*v, &keyVaultKeyURI) + if err != nil { + return err + } + daup.KeyVaultKeyURI = &keyVaultKeyURI + } + case "defaultIdentity": + if v != nil { + var defaultIdentity string + err = json.Unmarshal(*v, &defaultIdentity) + if err != nil { + return err + } + daup.DefaultIdentity = &defaultIdentity + } + case "publicNetworkAccess": + if v != nil { + var publicNetworkAccess PublicNetworkAccess + err = json.Unmarshal(*v, &publicNetworkAccess) + if err != nil { + return err + } + daup.PublicNetworkAccess = publicNetworkAccess + } + case "enableFreeTier": + if v != nil { + var enableFreeTier bool + err = json.Unmarshal(*v, &enableFreeTier) + if err != nil { + return err + } + daup.EnableFreeTier = &enableFreeTier + } + case "apiProperties": + if v != nil { + var APIProperties APIProperties + err = json.Unmarshal(*v, &APIProperties) + if err != nil { + return err + } + daup.APIProperties = &APIProperties + } + case "enableAnalyticalStorage": + if v != nil { + var enableAnalyticalStorage bool + err = json.Unmarshal(*v, &enableAnalyticalStorage) + if err != nil { + return err + } + daup.EnableAnalyticalStorage = &enableAnalyticalStorage + } + case "analyticalStorageConfiguration": + if v != nil { + var analyticalStorageConfiguration AnalyticalStorageConfiguration + err = json.Unmarshal(*v, &analyticalStorageConfiguration) + if err != nil { + return err + } + daup.AnalyticalStorageConfiguration = &analyticalStorageConfiguration + } + case "backupPolicy": + if v != nil { + backupPolicy, err := unmarshalBasicBackupPolicy(*v) + if err != nil { + return err + } + daup.BackupPolicy = backupPolicy + } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + daup.Cors = &cors + } + case "networkAclBypass": + if v != nil { + var networkACLBypass NetworkACLBypass + err = json.Unmarshal(*v, &networkACLBypass) + if err != nil { + return err + } + daup.NetworkACLBypass = networkACLBypass + } + case "networkAclBypassResourceIds": + if v != nil { + var networkACLBypassResourceIds []string + err = json.Unmarshal(*v, &networkACLBypassResourceIds) + if err != nil { + return err + } + daup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds + } + case "diagnosticLogSettings": + if v != nil { + var diagnosticLogSettings DiagnosticLogSettings + err = json.Unmarshal(*v, &diagnosticLogSettings) + if err != nil { + return err + } + daup.DiagnosticLogSettings = &diagnosticLogSettings + } + case "disableLocalAuth": + if v != nil { + var disableLocalAuth bool + err = json.Unmarshal(*v, &disableLocalAuth) + if err != nil { + return err + } + daup.DisableLocalAuth = &disableLocalAuth + } + } + } + + return nil +} + +// DatabaseRestoreResource specific Databases to restore. +type DatabaseRestoreResource struct { + // DatabaseName - The name of the database available for restore. + DatabaseName *string `json:"databaseName,omitempty"` + // CollectionNames - The names of the collections available for restore. + CollectionNames *[]string `json:"collectionNames,omitempty"` +} + +// DataCenterResource a managed Cassandra data center. +type DataCenterResource struct { + autorest.Response `json:"-"` + // Properties - Properties of a managed Cassandra data center. + Properties *DataCenterResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataCenterResource. +func (dcr DataCenterResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcr.Properties != nil { + objectMap["properties"] = dcr.Properties + } + return json.Marshal(objectMap) +} + +// DataCenterResourceProperties properties of a managed Cassandra data center. +type DataCenterResourceProperties struct { + // ProvisioningState - Possible values include: 'ManagedCassandraProvisioningStateCreating', 'ManagedCassandraProvisioningStateUpdating', 'ManagedCassandraProvisioningStateDeleting', 'ManagedCassandraProvisioningStateSucceeded', 'ManagedCassandraProvisioningStateFailed', 'ManagedCassandraProvisioningStateCanceled' + ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` + // DataCenterLocation - The region this data center should be created in. + DataCenterLocation *string `json:"dataCenterLocation,omitempty"` + // DelegatedSubnetID - Resource id of a subnet the nodes in this data center should have their network interfaces connected to. The subnet must be in the same region specified in 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/'. + DelegatedSubnetID *string `json:"delegatedSubnetId,omitempty"` + // NodeCount - The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for the data center to be scaled to match. To monitor the number of nodes and their status, use the fetchNodeStatus method on the cluster. + NodeCount *int32 `json:"nodeCount,omitempty"` + // SeedNodes - READ-ONLY; IP addresses for seed nodes in this data center. This is for reference. Generally you will want to use the seedNodes property on the cluster, which aggregates the seed nodes from all data centers in the cluster. + SeedNodes *[]SeedNode `json:"seedNodes,omitempty"` + // Base64EncodedCassandraYamlFragment - A fragment of a cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this data center. The fragment should be Base64 encoded, and only a subset of keys are allowed. + Base64EncodedCassandraYamlFragment *string `json:"base64EncodedCassandraYamlFragment,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataCenterResourceProperties. +func (dcr DataCenterResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcr.ProvisioningState != "" { + objectMap["provisioningState"] = dcr.ProvisioningState + } + if dcr.DataCenterLocation != nil { + objectMap["dataCenterLocation"] = dcr.DataCenterLocation + } + if dcr.DelegatedSubnetID != nil { + objectMap["delegatedSubnetId"] = dcr.DelegatedSubnetID + } + if dcr.NodeCount != nil { + objectMap["nodeCount"] = dcr.NodeCount + } + if dcr.Base64EncodedCassandraYamlFragment != nil { + objectMap["base64EncodedCassandraYamlFragment"] = dcr.Base64EncodedCassandraYamlFragment + } + return json.Marshal(objectMap) +} + +// DataTransferRegionalServiceResource resource for a regional service location. +type DataTransferRegionalServiceResource struct { + // Name - READ-ONLY; The regional service name. + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; The location name. + Location *string `json:"location,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataTransferRegionalServiceResource. +func (dtrsr DataTransferRegionalServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DataTransferServiceResource describes the service response property. +type DataTransferServiceResource struct { + Properties *DataTransferServiceResourceProperties `json:"properties,omitempty"` +} + +// DataTransferServiceResourceProperties properties for DataTransferServiceResource. +type DataTransferServiceResourceProperties struct { + // Locations - READ-ONLY; An array that contains all of the locations for the service. + Locations *[]DataTransferRegionalServiceResource `json:"locations,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CreationTime - READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // InstanceSize - Possible values include: 'CosmosD4s', 'CosmosD8s', 'CosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` + // ServiceType - Possible values include: 'ServiceTypeServiceResourceProperties', 'ServiceTypeDataTransfer', 'ServiceTypeSQLDedicatedGateway', 'ServiceTypeGraphAPICompute' + ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { + dtsrp.ServiceType = ServiceTypeDataTransfer + objectMap := make(map[string]interface{}) + if dtsrp.InstanceSize != "" { + objectMap["instanceSize"] = dtsrp.InstanceSize + } + if dtsrp.InstanceCount != nil { + objectMap["instanceCount"] = dtsrp.InstanceCount + } + if dtsrp.ServiceType != "" { + objectMap["serviceType"] = dtsrp.ServiceType + } + for k, v := range dtsrp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDataTransferServiceResourceProperties is the BasicServiceResourceProperties implementation for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) { + return &dtsrp, true +} + +// AsSQLDedicatedGatewayServiceResourceProperties is the BasicServiceResourceProperties implementation for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) { + return nil, false +} + +// AsGraphAPIComputeServiceResourceProperties is the BasicServiceResourceProperties implementation for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) AsGraphAPIComputeServiceResourceProperties() (*GraphAPIComputeServiceResourceProperties, bool) { + return nil, false +} + +// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { + return nil, false +} + +// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for DataTransferServiceResourceProperties. +func (dtsrp DataTransferServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { + return &dtsrp, true +} + +// UnmarshalJSON is the custom unmarshaler for DataTransferServiceResourceProperties struct. +func (dtsrp *DataTransferServiceResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "locations": + if v != nil { + var locations []DataTransferRegionalServiceResource + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + dtsrp.Locations = &locations + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if dtsrp.AdditionalProperties == nil { + dtsrp.AdditionalProperties = make(map[string]interface{}) + } + dtsrp.AdditionalProperties[k] = additionalProperties + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + dtsrp.CreationTime = &creationTime + } + case "instanceSize": + if v != nil { + var instanceSize ServiceSize + err = json.Unmarshal(*v, &instanceSize) + if err != nil { + return err + } + dtsrp.InstanceSize = instanceSize + } + case "instanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + dtsrp.InstanceCount = &instanceCount + } + case "status": + if v != nil { + var status ServiceStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + dtsrp.Status = status + } + case "serviceType": + if v != nil { + var serviceType ServiceTypeBasicServiceResourceProperties + err = json.Unmarshal(*v, &serviceType) + if err != nil { + return err + } + dtsrp.ServiceType = serviceType + } + } + } + + return nil +} + +// DiagnosticLogSettings indicates what diagnostic log settings are to be enabled. +type DiagnosticLogSettings struct { + // EnableFullTextQuery - Describe the level of detail with which queries are to be logged. Possible values include: 'None', 'True', 'False' + EnableFullTextQuery EnableFullTextQuery `json:"enableFullTextQuery,omitempty"` +} + +// ErrorResponse error Response. +type ErrorResponse struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// ExcludedPath ... +type ExcludedPath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` +} + +// ExtendedResourceProperties the system generated resource properties associated with SQL databases, SQL +// containers, Gremlin databases and Gremlin graphs. +type ExtendedResourceProperties struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedResourceProperties. +func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FailoverPolicies the list of new failover policies for the failover priority change. +type FailoverPolicies struct { + // FailoverPolicies - List of failover policies. + FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` +} + +// FailoverPolicy the failover policy for a given region of a database account. +type FailoverPolicy struct { + // ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. + ID *string `json:"id,omitempty"` + // LocationName - The name of the region in which the database account exists. + LocationName *string `json:"locationName,omitempty"` + // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + FailoverPriority *int32 `json:"failoverPriority,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailoverPolicy. +func (fp FailoverPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fp.LocationName != nil { + objectMap["locationName"] = fp.LocationName + } + if fp.FailoverPriority != nil { + objectMap["failoverPriority"] = fp.FailoverPriority + } + return json.Marshal(objectMap) +} + +// GraphAPIComputeRegionalServiceResource resource for a regional service location. +type GraphAPIComputeRegionalServiceResource struct { + // GraphAPIComputeEndpoint - READ-ONLY; The regional endpoint for GraphAPICompute. + GraphAPIComputeEndpoint *string `json:"graphApiComputeEndpoint,omitempty"` + // Name - READ-ONLY; The regional service name. + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; The location name. + Location *string `json:"location,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphAPIComputeRegionalServiceResource. +func (gacrsr GraphAPIComputeRegionalServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GraphAPIComputeServiceResource describes the service response property for GraphAPICompute. +type GraphAPIComputeServiceResource struct { + Properties *GraphAPIComputeServiceResourceProperties `json:"properties,omitempty"` +} + +// GraphAPIComputeServiceResourceProperties properties for GraphAPIComputeServiceResource. +type GraphAPIComputeServiceResourceProperties struct { + // GraphAPIComputeEndpoint - GraphAPICompute endpoint for the service. + GraphAPIComputeEndpoint *string `json:"graphApiComputeEndpoint,omitempty"` + // Locations - READ-ONLY; An array that contains all of the locations for the service. + Locations *[]GraphAPIComputeRegionalServiceResource `json:"locations,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CreationTime - READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // InstanceSize - Possible values include: 'CosmosD4s', 'CosmosD8s', 'CosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` + // ServiceType - Possible values include: 'ServiceTypeServiceResourceProperties', 'ServiceTypeDataTransfer', 'ServiceTypeSQLDedicatedGateway', 'ServiceTypeGraphAPICompute' + ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) MarshalJSON() ([]byte, error) { + gacsrp.ServiceType = ServiceTypeGraphAPICompute + objectMap := make(map[string]interface{}) + if gacsrp.GraphAPIComputeEndpoint != nil { + objectMap["graphApiComputeEndpoint"] = gacsrp.GraphAPIComputeEndpoint + } + if gacsrp.InstanceSize != "" { + objectMap["instanceSize"] = gacsrp.InstanceSize + } + if gacsrp.InstanceCount != nil { + objectMap["instanceCount"] = gacsrp.InstanceCount + } + if gacsrp.ServiceType != "" { + objectMap["serviceType"] = gacsrp.ServiceType + } + for k, v := range gacsrp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDataTransferServiceResourceProperties is the BasicServiceResourceProperties implementation for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) { + return nil, false +} + +// AsSQLDedicatedGatewayServiceResourceProperties is the BasicServiceResourceProperties implementation for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) { + return nil, false +} + +// AsGraphAPIComputeServiceResourceProperties is the BasicServiceResourceProperties implementation for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) AsGraphAPIComputeServiceResourceProperties() (*GraphAPIComputeServiceResourceProperties, bool) { + return &gacsrp, true +} + +// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { + return nil, false +} + +// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for GraphAPIComputeServiceResourceProperties. +func (gacsrp GraphAPIComputeServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { + return &gacsrp, true +} + +// UnmarshalJSON is the custom unmarshaler for GraphAPIComputeServiceResourceProperties struct. +func (gacsrp *GraphAPIComputeServiceResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "graphApiComputeEndpoint": + if v != nil { + var graphAPIComputeEndpoint string + err = json.Unmarshal(*v, &graphAPIComputeEndpoint) + if err != nil { + return err + } + gacsrp.GraphAPIComputeEndpoint = &graphAPIComputeEndpoint + } + case "locations": + if v != nil { + var locations []GraphAPIComputeRegionalServiceResource + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + gacsrp.Locations = &locations + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gacsrp.AdditionalProperties == nil { + gacsrp.AdditionalProperties = make(map[string]interface{}) + } + gacsrp.AdditionalProperties[k] = additionalProperties + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + gacsrp.CreationTime = &creationTime + } + case "instanceSize": + if v != nil { + var instanceSize ServiceSize + err = json.Unmarshal(*v, &instanceSize) + if err != nil { + return err + } + gacsrp.InstanceSize = instanceSize + } + case "instanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + gacsrp.InstanceCount = &instanceCount + } + case "status": + if v != nil { + var status ServiceStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + gacsrp.Status = status + } + case "serviceType": + if v != nil { + var serviceType ServiceTypeBasicServiceResourceProperties + err = json.Unmarshal(*v, &serviceType) + if err != nil { + return err + } + gacsrp.ServiceType = serviceType + } + } + } + + return nil +} + +// GraphResource cosmos DB Graph resource object +type GraphResource struct { + // ID - Name of the Cosmos DB Graph + ID *string `json:"id,omitempty"` +} + +// GraphResourceCreateUpdateParameters parameters to create and update Cosmos DB Graph resource. +type GraphResourceCreateUpdateParameters struct { + // GraphResourceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Graph resource. + *GraphResourceCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphResourceCreateUpdateParameters. +func (grcup GraphResourceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if grcup.GraphResourceCreateUpdateProperties != nil { + objectMap["properties"] = grcup.GraphResourceCreateUpdateProperties + } + if grcup.Location != nil { + objectMap["location"] = grcup.Location + } + if grcup.Tags != nil { + objectMap["tags"] = grcup.Tags + } + if grcup.Identity != nil { + objectMap["identity"] = grcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GraphResourceCreateUpdateParameters struct. +func (grcup *GraphResourceCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var graphResourceCreateUpdateProperties GraphResourceCreateUpdateProperties + err = json.Unmarshal(*v, &graphResourceCreateUpdateProperties) + if err != nil { + return err + } + grcup.GraphResourceCreateUpdateProperties = &graphResourceCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + grcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + grcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + grcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + grcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + grcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + grcup.Identity = &identity + } + } + } + + return nil +} + +// GraphResourceCreateUpdateProperties properties to create and update Azure Cosmos DB Graph resource. +type GraphResourceCreateUpdateProperties struct { + // Resource - The standard JSON format of a Graph resource + Resource *GraphResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GraphResourceGetProperties the properties of an Azure Cosmos DB SQL database +type GraphResourceGetProperties struct { + Resource *GraphResourceGetPropertiesResource `json:"resource,omitempty"` + Options *GraphResourceGetPropertiesOptions `json:"options,omitempty"` +} + +// GraphResourceGetPropertiesOptions ... +type GraphResourceGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// GraphResourceGetPropertiesResource ... +type GraphResourceGetPropertiesResource struct { + // ID - Name of the Cosmos DB Graph + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphResourceGetPropertiesResource. +func (grgp GraphResourceGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if grgp.ID != nil { + objectMap["id"] = grgp.ID + } + return json.Marshal(objectMap) +} + +// GraphResourceGetResults an Azure Cosmos DB Graph resource. +type GraphResourceGetResults struct { + autorest.Response `json:"-"` + // GraphResourceGetProperties - The properties of an Azure Cosmos DB Graph resource. + *GraphResourceGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphResourceGetResults. +func (grgr GraphResourceGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if grgr.GraphResourceGetProperties != nil { + objectMap["properties"] = grgr.GraphResourceGetProperties + } + if grgr.Location != nil { + objectMap["location"] = grgr.Location + } + if grgr.Tags != nil { + objectMap["tags"] = grgr.Tags + } + if grgr.Identity != nil { + objectMap["identity"] = grgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GraphResourceGetResults struct. +func (grgr *GraphResourceGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var graphResourceGetProperties GraphResourceGetProperties + err = json.Unmarshal(*v, &graphResourceGetProperties) + if err != nil { + return err + } + grgr.GraphResourceGetProperties = &graphResourceGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + grgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + grgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + grgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + grgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + grgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + grgr.Identity = &identity + } + } + } + + return nil +} + +// GraphResourcesCreateUpdateGraphFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GraphResourcesCreateUpdateGraphFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GraphResourcesClient) (GraphResourceGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GraphResourcesCreateUpdateGraphFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GraphResourcesCreateUpdateGraphFuture.Result. +func (future *GraphResourcesCreateUpdateGraphFuture) result(client GraphResourcesClient) (grgr GraphResourceGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesCreateUpdateGraphFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + grgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GraphResourcesCreateUpdateGraphFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if grgr.Response.Response, err = future.GetResult(sender); err == nil && grgr.Response.Response.StatusCode != http.StatusNoContent { + grgr, err = client.CreateUpdateGraphResponder(grgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesCreateUpdateGraphFuture", "Result", grgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GraphResourcesDeleteGraphResourceFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GraphResourcesDeleteGraphResourceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GraphResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GraphResourcesDeleteGraphResourceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GraphResourcesDeleteGraphResourceFuture.Result. +func (future *GraphResourcesDeleteGraphResourceFuture) result(client GraphResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GraphResourcesDeleteGraphResourceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GraphResourcesDeleteGraphResourceFuture") + return + } + ar.Response = future.Response() + return +} + +// GraphResourcesListResult the List operation response, that contains the Graph resource and their +// properties. +type GraphResourcesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Graph resource and their properties. + Value *[]GraphResourceGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphResourcesListResult. +func (grlr GraphResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GremlinDatabaseCreateUpdateParameters parameters to create and update Cosmos DB Gremlin database. +type GremlinDatabaseCreateUpdateParameters struct { + // GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database. + *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseCreateUpdateParameters. +func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdcup.GremlinDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties + } + if gdcup.Location != nil { + objectMap["location"] = gdcup.Location + } + if gdcup.Tags != nil { + objectMap["tags"] = gdcup.Tags + } + if gdcup.Identity != nil { + objectMap["identity"] = gdcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseCreateUpdateParameters struct. +func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties) + if err != nil { + return err + } + gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gdcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gdcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gdcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gdcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gdcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + gdcup.Identity = &identity + } + } + } + + return nil +} + +// GremlinDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin database. +type GremlinDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a Gremlin database + Resource *GremlinDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GremlinDatabaseGetProperties the properties of an Azure Cosmos DB SQL database +type GremlinDatabaseGetProperties struct { + Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// GremlinDatabaseGetPropertiesOptions ... +type GremlinDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// GremlinDatabaseGetPropertiesResource ... +type GremlinDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB Gremlin database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseGetPropertiesResource. +func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdgp.ID != nil { + objectMap["id"] = gdgp.ID + } + return json.Marshal(objectMap) +} + +// GremlinDatabaseGetResults an Azure Cosmos DB Gremlin database. +type GremlinDatabaseGetResults struct { + autorest.Response `json:"-"` + // GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database + *GremlinDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseGetResults. +func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdgr.GremlinDatabaseGetProperties != nil { + objectMap["properties"] = gdgr.GremlinDatabaseGetProperties + } + if gdgr.Location != nil { + objectMap["location"] = gdgr.Location + } + if gdgr.Tags != nil { + objectMap["tags"] = gdgr.Tags + } + if gdgr.Identity != nil { + objectMap["identity"] = gdgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseGetResults struct. +func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinDatabaseGetProperties GremlinDatabaseGetProperties + err = json.Unmarshal(*v, &gremlinDatabaseGetProperties) + if err != nil { + return err + } + gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gdgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gdgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gdgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + gdgr.Identity = &identity + } + } + } + + return nil +} + +// GremlinDatabaseListResult the List operation response, that contains the Gremlin databases and their +// properties. +type GremlinDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Gremlin databases and their properties. + Value *[]GremlinDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinDatabaseListResult. +func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GremlinDatabaseResource cosmos DB Gremlin database resource object +type GremlinDatabaseResource struct { + // ID - Name of the Cosmos DB Gremlin database + ID *string `json:"id,omitempty"` +} + +// GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateParameters struct { + // GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph. + *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters. +func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggcup.GremlinGraphCreateUpdateProperties != nil { + objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties + } + if ggcup.Location != nil { + objectMap["location"] = ggcup.Location + } + if ggcup.Tags != nil { + objectMap["tags"] = ggcup.Tags + } + if ggcup.Identity != nil { + objectMap["identity"] = ggcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct. +func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties + err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties) + if err != nil { + return err + } + ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ggcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ggcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ggcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ggcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ggcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ggcup.Identity = &identity + } + } + } + + return nil +} + +// GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph. +type GremlinGraphCreateUpdateProperties struct { + // Resource - The standard JSON format of a Gremlin graph + Resource *GremlinGraphResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GremlinGraphGetProperties the properties of an Azure Cosmos DB Gremlin graph +type GremlinGraphGetProperties struct { + Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"` + Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"` +} + +// GremlinGraphGetPropertiesOptions ... +type GremlinGraphGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// GremlinGraphGetPropertiesResource ... +type GremlinGraphGetPropertiesResource struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphGetPropertiesResource. +func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gggp.ID != nil { + objectMap["id"] = gggp.ID + } + if gggp.IndexingPolicy != nil { + objectMap["indexingPolicy"] = gggp.IndexingPolicy + } + if gggp.PartitionKey != nil { + objectMap["partitionKey"] = gggp.PartitionKey + } + if gggp.DefaultTTL != nil { + objectMap["defaultTtl"] = gggp.DefaultTTL + } + if gggp.UniqueKeyPolicy != nil { + objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy + } + if gggp.ConflictResolutionPolicy != nil { + objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy + } + return json.Marshal(objectMap) +} + +// GremlinGraphGetResults an Azure Cosmos DB Gremlin graph. +type GremlinGraphGetResults struct { + autorest.Response `json:"-"` + // GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph + *GremlinGraphGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphGetResults. +func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gggr.GremlinGraphGetProperties != nil { + objectMap["properties"] = gggr.GremlinGraphGetProperties + } + if gggr.Location != nil { + objectMap["location"] = gggr.Location + } + if gggr.Tags != nil { + objectMap["tags"] = gggr.Tags + } + if gggr.Identity != nil { + objectMap["identity"] = gggr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GremlinGraphGetResults struct. +func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var gremlinGraphGetProperties GremlinGraphGetProperties + err = json.Unmarshal(*v, &gremlinGraphGetProperties) + if err != nil { + return err + } + gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gggr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gggr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gggr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gggr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gggr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + gggr.Identity = &identity + } + } + } + + return nil +} + +// GremlinGraphListResult the List operation response, that contains the graphs and their properties. +type GremlinGraphListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of graphs and their properties. + Value *[]GremlinGraphGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for GremlinGraphListResult. +func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GremlinGraphResource cosmos DB Gremlin graph resource object +type GremlinGraphResource struct { + // ID - Name of the Cosmos DB Gremlin graph + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the graph. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` +} + +// GremlinResourcesCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesCreateUpdateGremlinDatabaseFuture.Result. +func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent { + gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type GremlinResourcesCreateUpdateGremlinGraphFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (GremlinGraphGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesCreateUpdateGremlinGraphFuture.Result. +func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gggr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent { + gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type GremlinResourcesDeleteGremlinDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesDeleteGremlinDatabaseFuture.Result. +func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// GremlinResourcesDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GremlinResourcesDeleteGremlinGraphFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesDeleteGremlinGraphFuture.Result. +func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture") + return + } + ar.Response = future.Response() + return +} + +// GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture.Result. +func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture.Result. +func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinGraphToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinGraphToAutoscaleFuture.Result. +func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesMigrateGremlinGraphToManualThroughputFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesMigrateGremlinGraphToManualThroughputFuture.Result. +func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesUpdateGremlinDatabaseThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesUpdateGremlinDatabaseThroughputFuture.Result. +func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// GremlinResourcesUpdateGremlinGraphThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type GremlinResourcesUpdateGremlinGraphThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GremlinResourcesUpdateGremlinGraphThroughputFuture.Result. +func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// IncludedPath the paths that are included in indexing +type IncludedPath struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Indexes - List of indexes for this path + Indexes *[]Indexes `json:"indexes,omitempty"` +} + +// Indexes the indexes for the path. +type Indexes struct { + // DataType - The datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon' + DataType DataType `json:"dataType,omitempty"` + // Precision - The precision of the index. -1 is maximum precision. + Precision *int32 `json:"precision,omitempty"` + // Kind - Indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial' + Kind IndexKind `json:"kind,omitempty"` +} + +// IndexingPolicy cosmos DB indexing policy +type IndexingPolicy struct { + // Automatic - Indicates if the indexing policy is automatic + Automatic *bool `json:"automatic,omitempty"` + // IndexingMode - Indicates the indexing mode. Possible values include: 'IndexingModeConsistent', 'IndexingModeLazy', 'IndexingModeNone' + IndexingMode IndexingMode `json:"indexingMode,omitempty"` + // IncludedPaths - List of paths to include in the indexing + IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"` + // ExcludedPaths - List of paths to exclude from indexing + ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"` + // CompositeIndexes - List of composite path list + CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"` + // SpatialIndexes - List of spatial specifics + SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"` +} + +// IPAddressOrRange ipAddressOrRange object +type IPAddressOrRange struct { + // IPAddressOrRange - A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. + IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"` +} + +// ListBackups list of restorable backups for a Cassandra cluster. +type ListBackups struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Container for array of backups. + Value *[]BackupResource `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ListBackups. +func (lb ListBackups) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListClusters list of managed Cassandra clusters. +type ListClusters struct { + autorest.Response `json:"-"` + // Value - Container for the array of clusters. + Value *[]ClusterResource `json:"value,omitempty"` +} + +// ListDataCenters list of managed Cassandra data centers and their properties. +type ListDataCenters struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Container for array of data centers. + Value *[]DataCenterResource `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ListDataCenters. +func (ldc ListDataCenters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Location a region in which the Azure Cosmos DB database account is deployed. +type Location struct { + // ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>. + ID *string `json:"id,omitempty"` + // LocationName - The name of the region. + LocationName *string `json:"locationName,omitempty"` + // DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ + DocumentEndpoint *string `json:"documentEndpoint,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + FailoverPriority *int32 `json:"failoverPriority,omitempty"` + // IsZoneRedundant - Flag to indicate whether or not this region is an AvailabilityZone region + IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"` +} + +// MarshalJSON is the custom marshaler for Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if l.LocationName != nil { + objectMap["locationName"] = l.LocationName + } + if l.ProvisioningState != nil { + objectMap["provisioningState"] = l.ProvisioningState + } + if l.FailoverPriority != nil { + objectMap["failoverPriority"] = l.FailoverPriority + } + if l.IsZoneRedundant != nil { + objectMap["isZoneRedundant"] = l.IsZoneRedundant + } + return json.Marshal(objectMap) +} + +// LocationGetResult cosmos DB location get result +type LocationGetResult struct { + autorest.Response `json:"-"` + // Properties - Cosmos DB location metadata + Properties *LocationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationGetResult. +func (lgr LocationGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lgr.Properties != nil { + objectMap["properties"] = lgr.Properties + } + return json.Marshal(objectMap) +} + +// LocationListResult the List operation response, that contains Cosmos DB locations and their properties. +type LocationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Cosmos DB locations and their properties. + Value *[]LocationGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationListResult. +func (llr LocationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LocationProperties cosmos DB location metadata +type LocationProperties struct { + // Status - READ-ONLY; The current status of location in Azure. + Status *string `json:"status,omitempty"` + // SupportsAvailabilityZone - READ-ONLY; Flag indicating whether the location supports availability zones or not. + SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty"` + // IsResidencyRestricted - READ-ONLY; Flag indicating whether the location is residency sensitive. + IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty"` + // BackupStorageRedundancies - READ-ONLY; The properties of available backup storage redundancies. + BackupStorageRedundancies *[]BackupStorageRedundancy `json:"backupStorageRedundancies,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationProperties. +func (lp LocationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ManagedServiceIdentity identity for the resource. +type ManagedServiceIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msi.Type != "" { + objectMap["type"] = msi.Type + } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. +func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Metric metric data +type Metric struct { + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for Metric. +func (mVar Metric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.Unit != "" { + objectMap["unit"] = mVar.Unit + } + return json.Marshal(objectMap) +} + +// MetricAvailability the availability of the metric. +type MetricAvailability struct { + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Retention - READ-ONLY; The retention for the metric values. + Retention *string `json:"retention,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricAvailability. +func (ma MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricDefinition the definition of a metric. +type MetricDefinition struct { + // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. + MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` + // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' + PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // ResourceURI - READ-ONLY; The resource uri of the database. + ResourceURI *string `json:"resourceUri,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricDefinition. +func (md MetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if md.Unit != "" { + objectMap["unit"] = md.Unit + } + return json.Marshal(objectMap) +} + +// MetricDefinitionsListResult the response to a list metric definitions request. +type MetricDefinitionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of metric definitions for the account. + Value *[]MetricDefinition `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricDefinitionsListResult. +func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricListResult the response to a list metrics request. +type MetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of metrics for the account. + Value *[]Metric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricListResult. +func (mlr MetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricName a metric name. +type MetricName struct { + // Value - READ-ONLY; The name of the metric. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The friendly name of the metric. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricName. +func (mn MetricName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MetricValue represents metrics values. +type MetricValue struct { + // Count - READ-ONLY; The number of values for the metric. + Count *float64 `json:"_count,omitempty"` + // Average - READ-ONLY; The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - READ-ONLY; The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - READ-ONLY; The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - READ-ONLY; The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + +// MarshalJSON is the custom marshaler for MetricValue. +func (mv MetricValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBCollectionCreateUpdateParameters parameters to create and update Cosmos DB MongoDB collection. +type MongoDBCollectionCreateUpdateParameters struct { + // MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection. + *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionCreateUpdateParameters. +func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdccup.MongoDBCollectionCreateUpdateProperties != nil { + objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties + } + if mdccup.Location != nil { + objectMap["location"] = mdccup.Location + } + if mdccup.Tags != nil { + objectMap["tags"] = mdccup.Tags + } + if mdccup.Identity != nil { + objectMap["identity"] = mdccup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionCreateUpdateParameters struct. +func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties + err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties) + if err != nil { + return err + } + mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdccup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdccup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdccup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mdccup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mdccup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mdccup.Identity = &identity + } + } + } + + return nil +} + +// MongoDBCollectionCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB +// collection. +type MongoDBCollectionCreateUpdateProperties struct { + // Resource - The standard JSON format of a MongoDB collection + Resource *MongoDBCollectionResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// MongoDBCollectionGetProperties the properties of an Azure Cosmos DB MongoDB collection +type MongoDBCollectionGetProperties struct { + Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"` + Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"` +} + +// MongoDBCollectionGetPropertiesOptions ... +type MongoDBCollectionGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// MongoDBCollectionGetPropertiesResource ... +type MongoDBCollectionGetPropertiesResource struct { + // ID - Name of the Cosmos DB MongoDB collection + ID *string `json:"id,omitempty"` + // ShardKey - A key-value pair of shard keys to be applied for the request. + ShardKey map[string]*string `json:"shardKey"` + // Indexes - List of index keys + Indexes *[]MongoIndex `json:"indexes,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionGetPropertiesResource. +func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcgp.ID != nil { + objectMap["id"] = mdcgp.ID + } + if mdcgp.ShardKey != nil { + objectMap["shardKey"] = mdcgp.ShardKey + } + if mdcgp.Indexes != nil { + objectMap["indexes"] = mdcgp.Indexes + } + if mdcgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// MongoDBCollectionGetResults an Azure Cosmos DB MongoDB collection. +type MongoDBCollectionGetResults struct { + autorest.Response `json:"-"` + // MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection + *MongoDBCollectionGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionGetResults. +func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcgr.MongoDBCollectionGetProperties != nil { + objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties + } + if mdcgr.Location != nil { + objectMap["location"] = mdcgr.Location + } + if mdcgr.Tags != nil { + objectMap["tags"] = mdcgr.Tags + } + if mdcgr.Identity != nil { + objectMap["identity"] = mdcgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionGetResults struct. +func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBCollectionGetProperties MongoDBCollectionGetProperties + err = json.Unmarshal(*v, &mongoDBCollectionGetProperties) + if err != nil { + return err + } + mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdcgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdcgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdcgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mdcgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mdcgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mdcgr.Identity = &identity + } + } + } + + return nil +} + +// MongoDBCollectionListResult the List operation response, that contains the MongoDB collections and their +// properties. +type MongoDBCollectionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB collections and their properties. + Value *[]MongoDBCollectionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionListResult. +func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBCollectionResource cosmos DB MongoDB collection resource object +type MongoDBCollectionResource struct { + // ID - Name of the Cosmos DB MongoDB collection + ID *string `json:"id,omitempty"` + // ShardKey - A key-value pair of shard keys to be applied for the request. + ShardKey map[string]*string `json:"shardKey"` + // Indexes - List of index keys + Indexes *[]MongoIndex `json:"indexes,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBCollectionResource. +func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdcr.ID != nil { + objectMap["id"] = mdcr.ID + } + if mdcr.ShardKey != nil { + objectMap["shardKey"] = mdcr.ShardKey + } + if mdcr.Indexes != nil { + objectMap["indexes"] = mdcr.Indexes + } + if mdcr.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// MongoDBDatabaseCreateUpdateParameters parameters to create and update Cosmos DB MongoDB database. +type MongoDBDatabaseCreateUpdateParameters struct { + // MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database. + *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseCreateUpdateParameters. +func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddcup.MongoDBDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties + } + if mddcup.Location != nil { + objectMap["location"] = mddcup.Location + } + if mddcup.Tags != nil { + objectMap["tags"] = mddcup.Tags + } + if mddcup.Identity != nil { + objectMap["identity"] = mddcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseCreateUpdateParameters struct. +func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties) + if err != nil { + return err + } + mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mddcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mddcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mddcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mddcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mddcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mddcup.Identity = &identity + } + } + } + + return nil +} + +// MongoDBDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB database. +type MongoDBDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a MongoDB database + Resource *MongoDBDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// MongoDBDatabaseGetProperties the properties of an Azure Cosmos DB MongoDB database +type MongoDBDatabaseGetProperties struct { + Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// MongoDBDatabaseGetPropertiesOptions ... +type MongoDBDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// MongoDBDatabaseGetPropertiesResource ... +type MongoDBDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB MongoDB database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseGetPropertiesResource. +func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddgp.ID != nil { + objectMap["id"] = mddgp.ID + } + return json.Marshal(objectMap) +} + +// MongoDBDatabaseGetResults an Azure Cosmos DB MongoDB database. +type MongoDBDatabaseGetResults struct { + autorest.Response `json:"-"` + // MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database + *MongoDBDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseGetResults. +func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mddgr.MongoDBDatabaseGetProperties != nil { + objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties + } + if mddgr.Location != nil { + objectMap["location"] = mddgr.Location + } + if mddgr.Tags != nil { + objectMap["tags"] = mddgr.Tags + } + if mddgr.Identity != nil { + objectMap["identity"] = mddgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseGetResults struct. +func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties + err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties) + if err != nil { + return err + } + mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mddgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mddgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mddgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mddgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mddgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mddgr.Identity = &identity + } + } + } + + return nil +} + +// MongoDBDatabaseListResult the List operation response, that contains the MongoDB databases and their +// properties. +type MongoDBDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB databases and their properties. + Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDBDatabaseListResult. +func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MongoDBDatabaseResource cosmos DB MongoDB database resource object +type MongoDBDatabaseResource struct { + // ID - Name of the Cosmos DB MongoDB database + ID *string `json:"id,omitempty"` +} + +// MongoDBResourcesCreateUpdateMongoDBCollectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBCollectionFuture.Result. +func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mdcgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent { + mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesCreateUpdateMongoDBDatabaseFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBDatabaseFuture.Result. +func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mddgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent { + mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesDeleteMongoDBCollectionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type MongoDBResourcesDeleteMongoDBCollectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesDeleteMongoDBCollectionFuture.Result. +func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture") + return + } + ar.Response = future.Response() + return +} + +// MongoDBResourcesDeleteMongoDBDatabaseFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type MongoDBResourcesDeleteMongoDBDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesDeleteMongoDBDatabaseFuture.Result. +func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture.Result. +func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesUpdateMongoDBCollectionThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesUpdateMongoDBCollectionThroughputFuture.Result. +func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture.Result. +func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// MongoIndex cosmos DB MongoDB collection index key +type MongoIndex struct { + // Key - Cosmos DB MongoDB collection index keys + Key *MongoIndexKeys `json:"key,omitempty"` + // Options - Cosmos DB MongoDB collection index key options + Options *MongoIndexOptions `json:"options,omitempty"` +} + +// MongoIndexKeys cosmos DB MongoDB collection resource object +type MongoIndexKeys struct { + // Keys - List of keys for each MongoDB collection in the Azure Cosmos DB service + Keys *[]string `json:"keys,omitempty"` +} + +// MongoIndexOptions cosmos DB MongoDB collection index options +type MongoIndexOptions struct { + // ExpireAfterSeconds - Expire after seconds + ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"` + // Unique - Is unique or not + Unique *bool `json:"unique,omitempty"` +} + +// NotebookWorkspace a notebook workspace resource +type NotebookWorkspace struct { + autorest.Response `json:"-"` + // NotebookWorkspaceProperties - Resource properties. + *NotebookWorkspaceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspace. +func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nw.NotebookWorkspaceProperties != nil { + objectMap["properties"] = nw.NotebookWorkspaceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NotebookWorkspace struct. +func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var notebookWorkspaceProperties NotebookWorkspaceProperties + err = json.Unmarshal(*v, ¬ebookWorkspaceProperties) + if err != nil { + return err + } + nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nw.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nw.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nw.Type = &typeVar + } + } + } + + return nil +} + +// NotebookWorkspaceConnectionInfoResult the connection info for the given notebook workspace +type NotebookWorkspaceConnectionInfoResult struct { + autorest.Response `json:"-"` + // AuthToken - READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth). + AuthToken *string `json:"authToken,omitempty"` + // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. + NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceConnectionInfoResult. +func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspaceCreateUpdateParameters parameters to create a notebook workspace resource +type NotebookWorkspaceCreateUpdateParameters struct { + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceCreateUpdateParameters. +func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspaceListResult a list of notebook workspace resources +type NotebookWorkspaceListResult struct { + autorest.Response `json:"-"` + // Value - Array of notebook workspace resources + Value *[]NotebookWorkspace `json:"value,omitempty"` +} + +// NotebookWorkspaceProperties properties of a notebook workspace resource. +type NotebookWorkspaceProperties struct { + // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. + NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` + // Status - READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. + Status *string `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotebookWorkspaceProperties. +func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NotebookWorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NotebookWorkspacesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (NotebookWorkspace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesCreateOrUpdateFuture.Result. +func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + nw.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent { + nw, err = client.CreateOrUpdateResponder(nw.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request") + } + } + return +} + +// NotebookWorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NotebookWorkspacesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesDeleteFuture.Result. +func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// NotebookWorkspacesRegenerateAuthTokenFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type NotebookWorkspacesRegenerateAuthTokenFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesRegenerateAuthTokenFuture.Result. +func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture") + return + } + ar.Response = future.Response() + return +} + +// NotebookWorkspacesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NotebookWorkspacesStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NotebookWorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NotebookWorkspacesStartFuture.Result. +func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// Operation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft.ResourceProvider + Provider *string `json:"Provider,omitempty"` + // Resource - Resource on which the operation is performed: Profile, endpoint, etc. + Resource *string `json:"Resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"Operation,omitempty"` + // Description - Description of operation + Description *string `json:"Description,omitempty"` +} + +// OperationListResult result of the request to list Resource Provider operations. It contains a list of +// operations and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the Resource Provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// OptionsResource cosmos DB options resource object +type OptionsResource struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// PartitionMetric the metric values for a single partition. +type PartitionMetric struct { + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionMetric. +func (pm PartitionMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pm.Unit != "" { + objectMap["unit"] = pm.Unit + } + return json.Marshal(objectMap) +} + +// PartitionMetricListResult the response to a list partition metrics request. +type PartitionMetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of partition-level metrics for the account. + Value *[]PartitionMetric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionMetricListResult. +func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PartitionUsage the partition level usage data for a usage request. +type PartitionUsage struct { + // PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // Limit - READ-ONLY; Maximum value for this metric + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - READ-ONLY; Current value for this metric + CurrentValue *int64 `json:"currentValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionUsage. +func (pu PartitionUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pu.Unit != "" { + objectMap["unit"] = pu.Unit + } + return json.Marshal(objectMap) +} + +// PartitionUsagesResult the response to a list partition level usage request. +type PartitionUsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric + Value *[]PartitionUsage `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartitionUsagesResult. +func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PercentileMetric percentile Metric data +type PercentileMetric struct { + // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep. + MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetric. +func (pm PercentileMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pm.Unit != "" { + objectMap["unit"] = pm.Unit + } + return json.Marshal(objectMap) +} + +// PercentileMetricListResult the response to a list percentile metrics request. +type PercentileMetricListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of percentile metrics for the account. + Value *[]PercentileMetric `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetricListResult. +func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PercentileMetricValue represents percentile metrics values. +type PercentileMetricValue struct { + // P10 - READ-ONLY; The 10th percentile value for the metric. + P10 *float64 `json:"P10,omitempty"` + // P25 - READ-ONLY; The 25th percentile value for the metric. + P25 *float64 `json:"P25,omitempty"` + // P50 - READ-ONLY; The 50th percentile value for the metric. + P50 *float64 `json:"P50,omitempty"` + // P75 - READ-ONLY; The 75th percentile value for the metric. + P75 *float64 `json:"P75,omitempty"` + // P90 - READ-ONLY; The 90th percentile value for the metric. + P90 *float64 `json:"P90,omitempty"` + // P95 - READ-ONLY; The 95th percentile value for the metric. + P95 *float64 `json:"P95,omitempty"` + // P99 - READ-ONLY; The 99th percentile value for the metric. + P99 *float64 `json:"P99,omitempty"` + // Count - READ-ONLY; The number of values for the metric. + Count *float64 `json:"_count,omitempty"` + // Average - READ-ONLY; The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - READ-ONLY; The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - READ-ONLY; The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - READ-ONLY; The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + +// MarshalJSON is the custom marshaler for PercentileMetricValue. +func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PeriodicModeBackupPolicy the object representing periodic mode backup policy. +type PeriodicModeBackupPolicy struct { + // PeriodicModeProperties - Configuration values for periodic mode backup + PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"` + // MigrationState - The object representing the state of the migration between the backup policies. + MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` + // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { + pmbp.Type = TypePeriodic + objectMap := make(map[string]interface{}) + if pmbp.PeriodicModeProperties != nil { + objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties + } + if pmbp.MigrationState != nil { + objectMap["migrationState"] = pmbp.MigrationState + } + if pmbp.Type != "" { + objectMap["type"] = pmbp.Type + } + return json.Marshal(objectMap) +} + +// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { + return &pmbp, true +} + +// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { + return nil, false +} + +// AsBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { + return nil, false +} + +// AsBasicBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. +func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { + return &pmbp, true +} + +// PeriodicModeProperties configuration values for periodic mode backup +type PeriodicModeProperties struct { + // BackupIntervalInMinutes - An integer representing the interval in minutes between two backups + BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"` + // BackupRetentionIntervalInHours - An integer representing the time (in hours) that each backup is retained + BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"` + // BackupStorageRedundancy - Enum to indicate type of backup residency. Possible values include: 'Geo', 'Local', 'Zone' + BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` +} + +// Permission the set of data plane operations permitted through this Role Definition. +type Permission struct { + // DataActions - An array of data actions that are allowed. + DataActions *[]string `json:"dataActions,omitempty"` + // NotDataActions - An array of data actions that are denied. + NotDataActions *[]string `json:"notDataActions,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // GroupID - Group id of the private endpoint. + GroupID *string `json:"groupId,omitempty"` + // ProvisioningState - Provisioning state of the private endpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateOrUpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointProperty private endpoint which the connection belongs to. +type PrivateEndpointProperty struct { + // ID - Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; The private link resource required zone names. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. +type PrivateLinkServiceConnectionStateProperty struct { + // Status - The private link service connection status. + Status *string `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. +func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscsp.Status != nil { + objectMap["status"] = plscsp.Status + } + if plscsp.Description != nil { + objectMap["description"] = plscsp.Description + } + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RegionalServiceResource resource for a regional service location. +type RegionalServiceResource struct { + // Name - READ-ONLY; The regional service name. + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; The location name. + Location *string `json:"location,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegionalServiceResource. +func (rsr RegionalServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RegionForOnlineOffline cosmos DB region to online or offline. +type RegionForOnlineOffline struct { + // Region - Cosmos DB region, with spaces between words and each word capitalized. + Region *string `json:"region,omitempty"` +} + +// RepairPostBody specification of the keyspaces and tables to run repair on. +type RepairPostBody struct { + // Keyspace - The name of the keyspace that repair should be run on. + Keyspace *string `json:"keyspace,omitempty"` + // Tables - List of tables in the keyspace to repair. If omitted, repair all tables in the keyspace. + Tables *[]string `json:"tables,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableDatabaseAccountGetResult a Azure Cosmos DB restorable database account. +type RestorableDatabaseAccountGetResult struct { + autorest.Response `json:"-"` + // RestorableDatabaseAccountProperties - The properties of a restorable database account. + *RestorableDatabaseAccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableDatabaseAccountGetResult. +func (rdagr RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rdagr.RestorableDatabaseAccountProperties != nil { + objectMap["properties"] = rdagr.RestorableDatabaseAccountProperties + } + if rdagr.Location != nil { + objectMap["location"] = rdagr.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorableDatabaseAccountGetResult struct. +func (rdagr *RestorableDatabaseAccountGetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorableDatabaseAccountProperties RestorableDatabaseAccountProperties + err = json.Unmarshal(*v, &restorableDatabaseAccountProperties) + if err != nil { + return err + } + rdagr.RestorableDatabaseAccountProperties = &restorableDatabaseAccountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rdagr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rdagr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rdagr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rdagr.Location = &location + } + } + } + + return nil +} + +// RestorableDatabaseAccountProperties the properties of a restorable database account. +type RestorableDatabaseAccountProperties struct { + // AccountName - The name of the global database account + AccountName *string `json:"accountName,omitempty"` + // CreationTime - The creation time of the restorable database account (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // DeletionTime - The time at which the restorable database account has been deleted (ISO-8601 format). + DeletionTime *date.Time `json:"deletionTime,omitempty"` + // APIType - READ-ONLY; The API type of the restorable database account. Possible values include: 'MongoDB', 'Gremlin', 'Cassandra', 'Table', 'SQL', 'GremlinV2' + APIType APIType `json:"apiType,omitempty"` + // RestorableLocations - READ-ONLY; List of regions where the of the database account can be restored from. + RestorableLocations *[]RestorableLocationResource `json:"restorableLocations,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableDatabaseAccountProperties. +func (rdap RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rdap.AccountName != nil { + objectMap["accountName"] = rdap.AccountName + } + if rdap.CreationTime != nil { + objectMap["creationTime"] = rdap.CreationTime + } + if rdap.DeletionTime != nil { + objectMap["deletionTime"] = rdap.DeletionTime + } + return json.Marshal(objectMap) +} + +// RestorableDatabaseAccountsListResult the List operation response, that contains the restorable database +// accounts and their properties. +type RestorableDatabaseAccountsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of restorable database accounts and their properties. + Value *[]RestorableDatabaseAccountGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableDatabaseAccountsListResult. +func (rdalr RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableLocationResource properties of the regional restorable account. +type RestorableLocationResource struct { + // LocationName - READ-ONLY; The location of the regional restorable account. + LocationName *string `json:"locationName,omitempty"` + // RegionalDatabaseAccountInstanceID - READ-ONLY; The instance id of the regional restorable account. + RegionalDatabaseAccountInstanceID *string `json:"regionalDatabaseAccountInstanceId,omitempty"` + // CreationTime - READ-ONLY; The creation time of the regional restorable database account (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // DeletionTime - READ-ONLY; The time at which the regional restorable database account has been deleted (ISO-8601 format). + DeletionTime *date.Time `json:"deletionTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableLocationResource. +func (rlr RestorableLocationResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableMongodbCollectionGetResult an Azure Cosmos DB MongoDB collection event +type RestorableMongodbCollectionGetResult struct { + // RestorableMongodbCollectionProperties - The properties of a MongoDB collection event. + *RestorableMongodbCollectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbCollectionGetResult. +func (rmcgr RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmcgr.RestorableMongodbCollectionProperties != nil { + objectMap["properties"] = rmcgr.RestorableMongodbCollectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorableMongodbCollectionGetResult struct. +func (rmcgr *RestorableMongodbCollectionGetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorableMongodbCollectionProperties RestorableMongodbCollectionProperties + err = json.Unmarshal(*v, &restorableMongodbCollectionProperties) + if err != nil { + return err + } + rmcgr.RestorableMongodbCollectionProperties = &restorableMongodbCollectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rmcgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rmcgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rmcgr.Type = &typeVar + } + } + } + + return nil +} + +// RestorableMongodbCollectionProperties the properties of an Azure Cosmos DB MongoDB collection event +type RestorableMongodbCollectionProperties struct { + // Resource - The resource of an Azure Cosmos DB MongoDB collection event + Resource *RestorableMongodbCollectionPropertiesResource `json:"resource,omitempty"` +} + +// RestorableMongodbCollectionPropertiesResource the resource of an Azure Cosmos DB MongoDB collection +// event +type RestorableMongodbCollectionPropertiesResource struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // OperationType - READ-ONLY; The operation type of this collection event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' + OperationType OperationType `json:"operationType,omitempty"` + // EventTimestamp - READ-ONLY; The time when this collection event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty"` + // OwnerID - READ-ONLY; The name of this MongoDB collection. + OwnerID *string `json:"ownerId,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB collection. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbCollectionPropertiesResource. +func (rmcp RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableMongodbCollectionsListResult the List operation response, that contains the MongoDB collection +// events and their properties. +type RestorableMongodbCollectionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB collection events and their properties. + Value *[]RestorableMongodbCollectionGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbCollectionsListResult. +func (rmclr RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableMongodbDatabaseGetResult an Azure Cosmos DB MongoDB database event +type RestorableMongodbDatabaseGetResult struct { + // RestorableMongodbDatabaseProperties - The properties of a MongoDB database event. + *RestorableMongodbDatabaseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbDatabaseGetResult. +func (rmdgr RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmdgr.RestorableMongodbDatabaseProperties != nil { + objectMap["properties"] = rmdgr.RestorableMongodbDatabaseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorableMongodbDatabaseGetResult struct. +func (rmdgr *RestorableMongodbDatabaseGetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorableMongodbDatabaseProperties RestorableMongodbDatabaseProperties + err = json.Unmarshal(*v, &restorableMongodbDatabaseProperties) + if err != nil { + return err + } + rmdgr.RestorableMongodbDatabaseProperties = &restorableMongodbDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rmdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rmdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rmdgr.Type = &typeVar + } + } + } + + return nil +} + +// RestorableMongodbDatabaseProperties the properties of an Azure Cosmos DB MongoDB database event +type RestorableMongodbDatabaseProperties struct { + // Resource - The resource of an Azure Cosmos DB MongoDB database event + Resource *RestorableMongodbDatabasePropertiesResource `json:"resource,omitempty"` +} + +// RestorableMongodbDatabasePropertiesResource the resource of an Azure Cosmos DB MongoDB database event +type RestorableMongodbDatabasePropertiesResource struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' + OperationType OperationType `json:"operationType,omitempty"` + // EventTimestamp - READ-ONLY; The time when this database event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty"` + // OwnerID - READ-ONLY; The name of this MongoDB database. + OwnerID *string `json:"ownerId,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB database. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbDatabasePropertiesResource. +func (rmdp RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableMongodbDatabasesListResult the List operation response, that contains the MongoDB database +// events and their properties. +type RestorableMongodbDatabasesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of MongoDB database events and their properties. + Value *[]RestorableMongodbDatabaseGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbDatabasesListResult. +func (rmdlr RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableMongodbResourcesListResult the List operation response, that contains the restorable MongoDB +// resources. +type RestorableMongodbResourcesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of restorable MongoDB resources, including the database and collection names. + Value *[]DatabaseRestoreResource `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableMongodbResourcesListResult. +func (rmrlr RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableSQLContainerGetResult an Azure Cosmos DB SQL container event +type RestorableSQLContainerGetResult struct { + // RestorableSQLContainerProperties - The properties of a SQL container event. + *RestorableSQLContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLContainerGetResult. +func (rscgr RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rscgr.RestorableSQLContainerProperties != nil { + objectMap["properties"] = rscgr.RestorableSQLContainerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorableSQLContainerGetResult struct. +func (rscgr *RestorableSQLContainerGetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorableSQLContainerProperties RestorableSQLContainerProperties + err = json.Unmarshal(*v, &restorableSQLContainerProperties) + if err != nil { + return err + } + rscgr.RestorableSQLContainerProperties = &restorableSQLContainerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rscgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rscgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rscgr.Type = &typeVar + } + } + } + + return nil +} + +// RestorableSQLContainerProperties the properties of an Azure Cosmos DB SQL container event +type RestorableSQLContainerProperties struct { + // Resource - The resource of an Azure Cosmos DB SQL container event + Resource *RestorableSQLContainerPropertiesResource `json:"resource,omitempty"` +} + +// RestorableSQLContainerPropertiesResource the resource of an Azure Cosmos DB SQL container event +type RestorableSQLContainerPropertiesResource struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // OperationType - READ-ONLY; The operation type of this container event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' + OperationType OperationType `json:"operationType,omitempty"` + // EventTimestamp - READ-ONLY; The when this container event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty"` + // OwnerID - READ-ONLY; The name of this SQL container. + OwnerID *string `json:"ownerId,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of this SQL container. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` + // Container - Cosmos DB SQL container resource object + Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLContainerPropertiesResource. +func (rscp RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rscp.Container != nil { + objectMap["container"] = rscp.Container + } + return json.Marshal(objectMap) +} + +// RestorableSQLContainerPropertiesResourceContainer cosmos DB SQL container resource object +type RestorableSQLContainerPropertiesResourceContainer struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` + // Self - READ-ONLY; A system generated property that specifies the addressable path of the container resource. + Self *string `json:"_self,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLContainerPropertiesResourceContainer. +func (rscp RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rscp.ID != nil { + objectMap["id"] = rscp.ID + } + if rscp.IndexingPolicy != nil { + objectMap["indexingPolicy"] = rscp.IndexingPolicy + } + if rscp.PartitionKey != nil { + objectMap["partitionKey"] = rscp.PartitionKey + } + if rscp.DefaultTTL != nil { + objectMap["defaultTtl"] = rscp.DefaultTTL + } + if rscp.UniqueKeyPolicy != nil { + objectMap["uniqueKeyPolicy"] = rscp.UniqueKeyPolicy + } + if rscp.ConflictResolutionPolicy != nil { + objectMap["conflictResolutionPolicy"] = rscp.ConflictResolutionPolicy + } + if rscp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = rscp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// RestorableSQLContainersListResult the List operation response, that contains the SQL container events +// and their properties. +type RestorableSQLContainersListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of SQL container events and their properties. + Value *[]RestorableSQLContainerGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLContainersListResult. +func (rsclr RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableSQLDatabaseGetResult an Azure Cosmos DB SQL database event +type RestorableSQLDatabaseGetResult struct { + // RestorableSQLDatabaseProperties - The properties of a SQL database event. + *RestorableSQLDatabaseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLDatabaseGetResult. +func (rsdgr RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsdgr.RestorableSQLDatabaseProperties != nil { + objectMap["properties"] = rsdgr.RestorableSQLDatabaseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorableSQLDatabaseGetResult struct. +func (rsdgr *RestorableSQLDatabaseGetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorableSQLDatabaseProperties RestorableSQLDatabaseProperties + err = json.Unmarshal(*v, &restorableSQLDatabaseProperties) + if err != nil { + return err + } + rsdgr.RestorableSQLDatabaseProperties = &restorableSQLDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rsdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rsdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsdgr.Type = &typeVar + } + } + } + + return nil +} + +// RestorableSQLDatabaseProperties the properties of an Azure Cosmos DB SQL database event +type RestorableSQLDatabaseProperties struct { + // Resource - The resource of an Azure Cosmos DB SQL database event + Resource *RestorableSQLDatabasePropertiesResource `json:"resource,omitempty"` +} + +// RestorableSQLDatabasePropertiesResource the resource of an Azure Cosmos DB SQL database event +type RestorableSQLDatabasePropertiesResource struct { + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'Create', 'Replace', 'Delete', 'SystemOperation' + OperationType OperationType `json:"operationType,omitempty"` + // EventTimestamp - READ-ONLY; The time when this database event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty"` + // OwnerID - READ-ONLY; The name of the SQL database. + OwnerID *string `json:"ownerId,omitempty"` + // OwnerResourceID - READ-ONLY; The resource ID of the SQL database. + OwnerResourceID *string `json:"ownerResourceId,omitempty"` + // Database - Cosmos DB SQL database resource object + Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLDatabasePropertiesResource. +func (rsdp RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsdp.Database != nil { + objectMap["database"] = rsdp.Database + } + return json.Marshal(objectMap) +} + +// RestorableSQLDatabasePropertiesResourceDatabase cosmos DB SQL database resource object +type RestorableSQLDatabasePropertiesResourceDatabase struct { + // ID - Name of the Cosmos DB SQL database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` + // Colls - READ-ONLY; A system generated property that specified the addressable path of the collections resource. + Colls *string `json:"_colls,omitempty"` + // Users - READ-ONLY; A system generated property that specifies the addressable path of the users resource. + Users *string `json:"_users,omitempty"` + // Self - READ-ONLY; A system generated property that specifies the addressable path of the database resource. + Self *string `json:"_self,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLDatabasePropertiesResourceDatabase. +func (rsdp RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsdp.ID != nil { + objectMap["id"] = rsdp.ID + } + return json.Marshal(objectMap) +} + +// RestorableSQLDatabasesListResult the List operation response, that contains the SQL database events and +// their properties. +type RestorableSQLDatabasesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of SQL database events and their properties. + Value *[]RestorableSQLDatabaseGetResult `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLDatabasesListResult. +func (rsdlr RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestorableSQLResourcesListResult the List operation response, that contains the restorable SQL +// resources. +type RestorableSQLResourcesListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of restorable SQL resources, including the database and collection names. + Value *[]DatabaseRestoreResource `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorableSQLResourcesListResult. +func (rsrlr RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RestoreParameters parameters to indicate the information about the restore. +type RestoreParameters struct { + // RestoreMode - Describes the mode of the restore. Possible values include: 'PointInTime' + RestoreMode RestoreMode `json:"restoreMode,omitempty"` + // RestoreSource - The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} + RestoreSource *string `json:"restoreSource,omitempty"` + // RestoreTimestampInUtc - Time to which the account has to be restored (ISO-8601 format). + RestoreTimestampInUtc *date.Time `json:"restoreTimestampInUtc,omitempty"` + // DatabasesToRestore - List of specific databases available for restore. + DatabasesToRestore *[]DatabaseRestoreResource `json:"databasesToRestore,omitempty"` +} + +// SeedNode ... +type SeedNode struct { + // IPAddress - IP address of this seed node. + IPAddress *string `json:"ipAddress,omitempty"` +} + +// ServiceCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceClient) (ServiceResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceCreateFuture.Result. +func (future *ServiceCreateFuture) result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.ServiceCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.CreateResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceCreateFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceDeleteFuture.Result. +func (future *ServiceDeleteFuture) result(client ServiceClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.ServiceDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServiceResource properties for the database account. +type ServiceResource struct { + autorest.Response `json:"-"` + Properties BasicServiceResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceResource. +func (sr ServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = sr.Properties + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. +func (sr *ServiceResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicServiceResourceProperties(*v) + if err != nil { + return err + } + sr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sr.Type = &typeVar + } + } + } + + return nil +} + +// ServiceResourceCreateUpdateParameters parameters for Create or Update Request for ServiceResource +type ServiceResourceCreateUpdateParameters struct { + *ServiceResourceCreateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceResourceCreateUpdateParameters. +func (srcup ServiceResourceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srcup.ServiceResourceCreateUpdateProperties != nil { + objectMap["properties"] = srcup.ServiceResourceCreateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceResourceCreateUpdateParameters struct. +func (srcup *ServiceResourceCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceResourceCreateUpdateProperties ServiceResourceCreateUpdateProperties + err = json.Unmarshal(*v, &serviceResourceCreateUpdateProperties) + if err != nil { + return err + } + srcup.ServiceResourceCreateUpdateProperties = &serviceResourceCreateUpdateProperties + } + } + } + + return nil +} + +// ServiceResourceCreateUpdateProperties properties in ServiceResourceCreateUpdateParameters. +type ServiceResourceCreateUpdateProperties struct { + // InstanceSize - Possible values include: 'CosmosD4s', 'CosmosD8s', 'CosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // ServiceType - Possible values include: 'SQLDedicatedGateway', 'DataTransfer', 'GraphAPICompute' + ServiceType ServiceType `json:"serviceType,omitempty"` +} + +// ServiceResourceListResult the List operation response, that contains the Service Resource and their +// properties. +type ServiceResourceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Service Resource and their properties. + Value *[]ServiceResource `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceResourceListResult. +func (srlr ServiceResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicServiceResourceProperties services response resource. +type BasicServiceResourceProperties interface { + AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) + AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) + AsGraphAPIComputeServiceResourceProperties() (*GraphAPIComputeServiceResourceProperties, bool) + AsServiceResourceProperties() (*ServiceResourceProperties, bool) +} + +// ServiceResourceProperties services response resource. +type ServiceResourceProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CreationTime - READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // InstanceSize - Possible values include: 'CosmosD4s', 'CosmosD8s', 'CosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` + // ServiceType - Possible values include: 'ServiceTypeServiceResourceProperties', 'ServiceTypeDataTransfer', 'ServiceTypeSQLDedicatedGateway', 'ServiceTypeGraphAPICompute' + ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` +} + +func unmarshalBasicServiceResourceProperties(body []byte) (BasicServiceResourceProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["serviceType"] { + case string(ServiceTypeDataTransfer): + var dtsrp DataTransferServiceResourceProperties + err := json.Unmarshal(body, &dtsrp) + return dtsrp, err + case string(ServiceTypeSQLDedicatedGateway): + var sdgsrp SQLDedicatedGatewayServiceResourceProperties + err := json.Unmarshal(body, &sdgsrp) + return sdgsrp, err + case string(ServiceTypeGraphAPICompute): + var gacsrp GraphAPIComputeServiceResourceProperties + err := json.Unmarshal(body, &gacsrp) + return gacsrp, err + default: + var srp ServiceResourceProperties + err := json.Unmarshal(body, &srp) + return srp, err + } +} +func unmarshalBasicServiceResourcePropertiesArray(body []byte) ([]BasicServiceResourceProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + srpArray := make([]BasicServiceResourceProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + srp, err := unmarshalBasicServiceResourceProperties(*rawMessage) + if err != nil { + return nil, err + } + srpArray[index] = srp + } + return srpArray, nil +} + +// MarshalJSON is the custom marshaler for ServiceResourceProperties. +func (srp ServiceResourceProperties) MarshalJSON() ([]byte, error) { + srp.ServiceType = ServiceTypeServiceResourceProperties + objectMap := make(map[string]interface{}) + if srp.InstanceSize != "" { + objectMap["instanceSize"] = srp.InstanceSize + } + if srp.InstanceCount != nil { + objectMap["instanceCount"] = srp.InstanceCount + } + if srp.ServiceType != "" { + objectMap["serviceType"] = srp.ServiceType + } + for k, v := range srp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDataTransferServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. +func (srp ServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) { + return nil, false +} + +// AsSQLDedicatedGatewayServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. +func (srp ServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) { + return nil, false +} + +// AsGraphAPIComputeServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. +func (srp ServiceResourceProperties) AsGraphAPIComputeServiceResourceProperties() (*GraphAPIComputeServiceResourceProperties, bool) { + return nil, false +} + +// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. +func (srp ServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { + return &srp, true +} + +// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for ServiceResourceProperties. +func (srp ServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { + return &srp, true +} + +// UnmarshalJSON is the custom unmarshaler for ServiceResourceProperties struct. +func (srp *ServiceResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if srp.AdditionalProperties == nil { + srp.AdditionalProperties = make(map[string]interface{}) + } + srp.AdditionalProperties[k] = additionalProperties + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + srp.CreationTime = &creationTime + } + case "instanceSize": + if v != nil { + var instanceSize ServiceSize + err = json.Unmarshal(*v, &instanceSize) + if err != nil { + return err + } + srp.InstanceSize = instanceSize + } + case "instanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + srp.InstanceCount = &instanceCount + } + case "status": + if v != nil { + var status ServiceStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + srp.Status = status + } + case "serviceType": + if v != nil { + var serviceType ServiceTypeBasicServiceResourceProperties + err = json.Unmarshal(*v, &serviceType) + if err != nil { + return err + } + srp.ServiceType = serviceType + } + } + } + + return nil +} + +// SpatialSpec ... +type SpatialSpec struct { + // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) + Path *string `json:"path,omitempty"` + // Types - List of path's spatial type + Types *[]SpatialType `json:"types,omitempty"` +} + +// SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container. +type SQLContainerCreateUpdateParameters struct { + // SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. + *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters. +func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccup.SQLContainerCreateUpdateProperties != nil { + objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties + } + if sccup.Location != nil { + objectMap["location"] = sccup.Location + } + if sccup.Tags != nil { + objectMap["tags"] = sccup.Tags + } + if sccup.Identity != nil { + objectMap["identity"] = sccup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct. +func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties + err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties) + if err != nil { + return err + } + sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sccup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sccup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sccup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sccup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sccup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sccup.Identity = &identity + } + } + } + + return nil +} + +// SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. +type SQLContainerCreateUpdateProperties struct { + // Resource - The standard JSON format of a container + Resource *SQLContainerResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLContainerGetProperties the properties of an Azure Cosmos DB container +type SQLContainerGetProperties struct { + Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"` + Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"` +} + +// SQLContainerGetPropertiesOptions ... +type SQLContainerGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// SQLContainerGetPropertiesResource ... +type SQLContainerGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerGetPropertiesResource. +func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scgp.ID != nil { + objectMap["id"] = scgp.ID + } + if scgp.IndexingPolicy != nil { + objectMap["indexingPolicy"] = scgp.IndexingPolicy + } + if scgp.PartitionKey != nil { + objectMap["partitionKey"] = scgp.PartitionKey + } + if scgp.DefaultTTL != nil { + objectMap["defaultTtl"] = scgp.DefaultTTL + } + if scgp.UniqueKeyPolicy != nil { + objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy + } + if scgp.ConflictResolutionPolicy != nil { + objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy + } + if scgp.AnalyticalStorageTTL != nil { + objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL + } + return json.Marshal(objectMap) +} + +// SQLContainerGetResults an Azure Cosmos DB container. +type SQLContainerGetResults struct { + autorest.Response `json:"-"` + // SQLContainerGetProperties - The properties of an Azure Cosmos DB container + *SQLContainerGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerGetResults. +func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scgr.SQLContainerGetProperties != nil { + objectMap["properties"] = scgr.SQLContainerGetProperties + } + if scgr.Location != nil { + objectMap["location"] = scgr.Location + } + if scgr.Tags != nil { + objectMap["tags"] = scgr.Tags + } + if scgr.Identity != nil { + objectMap["identity"] = scgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLContainerGetResults struct. +func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLContainerGetProperties SQLContainerGetProperties + err = json.Unmarshal(*v, &SQLContainerGetProperties) + if err != nil { + return err + } + scgr.SQLContainerGetProperties = &SQLContainerGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + scgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + scgr.Identity = &identity + } + } + } + + return nil +} + +// SQLContainerListResult the List operation response, that contains the containers and their properties. +type SQLContainerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of containers and their properties. + Value *[]SQLContainerGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLContainerListResult. +func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLContainerResource cosmos DB SQL container resource object +type SQLContainerResource struct { + // ID - Name of the Cosmos DB SQL container + ID *string `json:"id,omitempty"` + // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container + IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` + // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions + PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` + // DefaultTTL - Default time to live + DefaultTTL *int32 `json:"defaultTtl,omitempty"` + // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` + // ConflictResolutionPolicy - The conflict resolution policy for the container. + ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + // AnalyticalStorageTTL - Analytical TTL. + AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` +} + +// SQLDatabaseCreateUpdateParameters parameters to create and update Cosmos DB SQL database. +type SQLDatabaseCreateUpdateParameters struct { + // SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database. + *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseCreateUpdateParameters. +func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdcup.SQLDatabaseCreateUpdateProperties != nil { + objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties + } + if sdcup.Location != nil { + objectMap["location"] = sdcup.Location + } + if sdcup.Tags != nil { + objectMap["tags"] = sdcup.Tags + } + if sdcup.Identity != nil { + objectMap["identity"] = sdcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLDatabaseCreateUpdateParameters struct. +func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties + err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties) + if err != nil { + return err + } + sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sdcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sdcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sdcup.Identity = &identity + } + } + } + + return nil +} + +// SQLDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB SQL database. +type SQLDatabaseCreateUpdateProperties struct { + // Resource - The standard JSON format of a SQL database + Resource *SQLDatabaseResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLDatabaseGetProperties the properties of an Azure Cosmos DB SQL database +type SQLDatabaseGetProperties struct { + Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"` + Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"` +} + +// SQLDatabaseGetPropertiesOptions ... +type SQLDatabaseGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// SQLDatabaseGetPropertiesResource ... +type SQLDatabaseGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL database + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` + // Colls - A system generated property that specified the addressable path of the collections resource. + Colls *string `json:"_colls,omitempty"` + // Users - A system generated property that specifies the addressable path of the users resource. + Users *string `json:"_users,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseGetPropertiesResource. +func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdgp.ID != nil { + objectMap["id"] = sdgp.ID + } + if sdgp.Colls != nil { + objectMap["_colls"] = sdgp.Colls + } + if sdgp.Users != nil { + objectMap["_users"] = sdgp.Users + } + return json.Marshal(objectMap) +} + +// SQLDatabaseGetResults an Azure Cosmos DB SQL database. +type SQLDatabaseGetResults struct { + autorest.Response `json:"-"` + // SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database + *SQLDatabaseGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseGetResults. +func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdgr.SQLDatabaseGetProperties != nil { + objectMap["properties"] = sdgr.SQLDatabaseGetProperties + } + if sdgr.Location != nil { + objectMap["location"] = sdgr.Location + } + if sdgr.Tags != nil { + objectMap["tags"] = sdgr.Tags + } + if sdgr.Identity != nil { + objectMap["identity"] = sdgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLDatabaseGetResults struct. +func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLDatabaseGetProperties SQLDatabaseGetProperties + err = json.Unmarshal(*v, &SQLDatabaseGetProperties) + if err != nil { + return err + } + sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sdgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sdgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sdgr.Identity = &identity + } + } + } + + return nil +} + +// SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties. +type SQLDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of SQL databases and their properties. + Value *[]SQLDatabaseGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseListResult. +func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLDatabaseResource cosmos DB SQL database resource object +type SQLDatabaseResource struct { + // ID - Name of the Cosmos DB SQL database + ID *string `json:"id,omitempty"` +} + +// SQLDedicatedGatewayRegionalServiceResource resource for a regional service location. +type SQLDedicatedGatewayRegionalServiceResource struct { + // SQLDedicatedGatewayEndpoint - READ-ONLY; The regional endpoint for SqlDedicatedGateway. + SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty"` + // Name - READ-ONLY; The regional service name. + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; The location name. + Location *string `json:"location,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDedicatedGatewayRegionalServiceResource. +func (sdgrsr SQLDedicatedGatewayRegionalServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLDedicatedGatewayServiceResource describes the service response property for SqlDedicatedGateway. +type SQLDedicatedGatewayServiceResource struct { + Properties *SQLDedicatedGatewayServiceResourceProperties `json:"properties,omitempty"` +} + +// SQLDedicatedGatewayServiceResourceProperties properties for SqlDedicatedGatewayServiceResource. +type SQLDedicatedGatewayServiceResourceProperties struct { + // SQLDedicatedGatewayEndpoint - SqlDedicatedGateway endpoint for the service. + SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty"` + // Locations - READ-ONLY; An array that contains all of the locations for the service. + Locations *[]SQLDedicatedGatewayRegionalServiceResource `json:"locations,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CreationTime - READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *date.Time `json:"creationTime,omitempty"` + // InstanceSize - Possible values include: 'CosmosD4s', 'CosmosD8s', 'CosmosD16s' + InstanceSize ServiceSize `json:"instanceSize,omitempty"` + // InstanceCount - Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + // Status - READ-ONLY; Possible values include: 'ServiceStatusCreating', 'ServiceStatusRunning', 'ServiceStatusUpdating', 'ServiceStatusDeleting', 'ServiceStatusError', 'ServiceStatusStopped' + Status ServiceStatus `json:"status,omitempty"` + // ServiceType - Possible values include: 'ServiceTypeServiceResourceProperties', 'ServiceTypeDataTransfer', 'ServiceTypeSQLDedicatedGateway', 'ServiceTypeGraphAPICompute' + ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) MarshalJSON() ([]byte, error) { + sdgsrp.ServiceType = ServiceTypeSQLDedicatedGateway + objectMap := make(map[string]interface{}) + if sdgsrp.SQLDedicatedGatewayEndpoint != nil { + objectMap["sqlDedicatedGatewayEndpoint"] = sdgsrp.SQLDedicatedGatewayEndpoint + } + if sdgsrp.InstanceSize != "" { + objectMap["instanceSize"] = sdgsrp.InstanceSize + } + if sdgsrp.InstanceCount != nil { + objectMap["instanceCount"] = sdgsrp.InstanceCount + } + if sdgsrp.ServiceType != "" { + objectMap["serviceType"] = sdgsrp.ServiceType + } + for k, v := range sdgsrp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDataTransferServiceResourceProperties is the BasicServiceResourceProperties implementation for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) { + return nil, false +} + +// AsSQLDedicatedGatewayServiceResourceProperties is the BasicServiceResourceProperties implementation for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) { + return &sdgsrp, true +} + +// AsGraphAPIComputeServiceResourceProperties is the BasicServiceResourceProperties implementation for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsGraphAPIComputeServiceResourceProperties() (*GraphAPIComputeServiceResourceProperties, bool) { + return nil, false +} + +// AsServiceResourceProperties is the BasicServiceResourceProperties implementation for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) { + return nil, false +} + +// AsBasicServiceResourceProperties is the BasicServiceResourceProperties implementation for SQLDedicatedGatewayServiceResourceProperties. +func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) { + return &sdgsrp, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDedicatedGatewayServiceResourceProperties struct. +func (sdgsrp *SQLDedicatedGatewayServiceResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sqlDedicatedGatewayEndpoint": + if v != nil { + var SQLDedicatedGatewayEndpoint string + err = json.Unmarshal(*v, &SQLDedicatedGatewayEndpoint) + if err != nil { + return err + } + sdgsrp.SQLDedicatedGatewayEndpoint = &SQLDedicatedGatewayEndpoint + } + case "locations": + if v != nil { + var locations []SQLDedicatedGatewayRegionalServiceResource + err = json.Unmarshal(*v, &locations) + if err != nil { + return err + } + sdgsrp.Locations = &locations + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sdgsrp.AdditionalProperties == nil { + sdgsrp.AdditionalProperties = make(map[string]interface{}) + } + sdgsrp.AdditionalProperties[k] = additionalProperties + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + sdgsrp.CreationTime = &creationTime + } + case "instanceSize": + if v != nil { + var instanceSize ServiceSize + err = json.Unmarshal(*v, &instanceSize) + if err != nil { + return err + } + sdgsrp.InstanceSize = instanceSize + } + case "instanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + sdgsrp.InstanceCount = &instanceCount + } + case "status": + if v != nil { + var status ServiceStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + sdgsrp.Status = status + } + case "serviceType": + if v != nil { + var serviceType ServiceTypeBasicServiceResourceProperties + err = json.Unmarshal(*v, &serviceType) + if err != nil { + return err + } + sdgsrp.ServiceType = serviceType + } + } + } + + return nil +} + +// SQLResourcesCreateUpdateSQLContainerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLContainerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLContainerGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLContainerFuture.Result. +func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + scgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent { + scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLDatabaseGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLDatabaseFuture.Result. +func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent { + sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesCreateUpdateSQLRoleAssignmentFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLRoleAssignmentGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLRoleAssignmentFuture.Result. +func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) result(client SQLResourcesClient) (sragr SQLRoleAssignmentGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sragr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sragr.Response.Response, err = future.GetResult(sender); err == nil && sragr.Response.Response.StatusCode != http.StatusNoContent { + sragr, err = client.CreateUpdateSQLRoleAssignmentResponder(sragr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", sragr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesCreateUpdateSQLRoleDefinitionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLRoleDefinitionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLRoleDefinitionFuture.Result. +func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) result(client SQLResourcesClient) (srdgr SQLRoleDefinitionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + srdgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if srdgr.Response.Response, err = future.GetResult(sender); err == nil && srdgr.Response.Response.StatusCode != http.StatusNoContent { + srdgr, err = client.CreateUpdateSQLRoleDefinitionResponder(srdgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", srdgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLStoredProcedureFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLStoredProcedureFuture.Result. +func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sspgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent { + sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLTriggerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesCreateUpdateSQLTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLTriggerGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLTriggerFuture.Result. +func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + stgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent { + stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture.Result. +func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sudfgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent { + sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesDeleteSQLContainerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLContainerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLContainerFuture.Result. +func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLDatabaseFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLDatabaseFuture.Result. +func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLRoleAssignmentFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLRoleAssignmentFuture.Result. +func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLRoleDefinitionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLRoleDefinitionFuture.Result. +func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLStoredProcedureFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLStoredProcedureFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLStoredProcedureFuture.Result. +func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLTriggerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SQLResourcesDeleteSQLTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLTriggerFuture.Result. +func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesDeleteSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesDeleteSQLUserDefinedFunctionFuture.Result. +func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture") + return + } + ar.Response = future.Response() + return +} + +// SQLResourcesMigrateSQLContainerToAutoscaleFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLContainerToAutoscaleFuture.Result. +func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLContainerToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLContainerToManualThroughputFuture.Result. +func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLDatabaseToAutoscaleFuture.Result. +func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesMigrateSQLDatabaseToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesMigrateSQLDatabaseToManualThroughputFuture.Result. +func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesRetrieveContinuousBackupInformationFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type SQLResourcesRetrieveContinuousBackupInformationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (BackupInformation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesRetrieveContinuousBackupInformationFuture.Result. +func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) result(client SQLResourcesClient) (bi BackupInformation, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bi.Response.Response, err = future.GetResult(sender); err == nil && bi.Response.Response.StatusCode != http.StatusNoContent { + bi, err = client.RetrieveContinuousBackupInformationResponder(bi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", bi.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesUpdateSQLContainerThroughputFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesUpdateSQLContainerThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesUpdateSQLContainerThroughputFuture.Result. +func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLResourcesUpdateSQLDatabaseThroughputFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type SQLResourcesUpdateSQLDatabaseThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SQLResourcesUpdateSQLDatabaseThroughputFuture.Result. +func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// SQLRoleAssignmentCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role +// Assignment. +type SQLRoleAssignmentCreateUpdateParameters struct { + // SQLRoleAssignmentResource - Properties to create and update an Azure Cosmos DB SQL Role Assignment. + *SQLRoleAssignmentResource `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentCreateUpdateParameters. +func (sracup SQLRoleAssignmentCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sracup.SQLRoleAssignmentResource != nil { + objectMap["properties"] = sracup.SQLRoleAssignmentResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentCreateUpdateParameters struct. +func (sracup *SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleAssignmentResource SQLRoleAssignmentResource + err = json.Unmarshal(*v, &SQLRoleAssignmentResource) + if err != nil { + return err + } + sracup.SQLRoleAssignmentResource = &SQLRoleAssignmentResource + } + } + } + + return nil +} + +// SQLRoleAssignmentGetResults an Azure Cosmos DB Role Assignment +type SQLRoleAssignmentGetResults struct { + autorest.Response `json:"-"` + // SQLRoleAssignmentResource - Properties related to the Role Assignment. + *SQLRoleAssignmentResource `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentGetResults. +func (sragr SQLRoleAssignmentGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sragr.SQLRoleAssignmentResource != nil { + objectMap["properties"] = sragr.SQLRoleAssignmentResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentGetResults struct. +func (sragr *SQLRoleAssignmentGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleAssignmentResource SQLRoleAssignmentResource + err = json.Unmarshal(*v, &SQLRoleAssignmentResource) + if err != nil { + return err + } + sragr.SQLRoleAssignmentResource = &SQLRoleAssignmentResource + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sragr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sragr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sragr.Type = &typeVar + } + } + } + + return nil +} + +// SQLRoleAssignmentListResult the relevant Role Assignments. +type SQLRoleAssignmentListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Role Assignments and their properties + Value *[]SQLRoleAssignmentGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleAssignmentListResult. +func (sralr SQLRoleAssignmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLRoleAssignmentResource azure Cosmos DB SQL Role Assignment resource object. +type SQLRoleAssignmentResource struct { + // RoleDefinitionID - The unique identifier for the associated Role Definition. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` + // Scope - The data plane resource path for which access is being granted through this Role Assignment. + Scope *string `json:"scope,omitempty"` + // PrincipalID - The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + PrincipalID *string `json:"principalId,omitempty"` +} + +// SQLRoleDefinitionCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role +// Definition. +type SQLRoleDefinitionCreateUpdateParameters struct { + // SQLRoleDefinitionResource - Properties to create and update an Azure Cosmos DB SQL Role Definition. + *SQLRoleDefinitionResource `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionCreateUpdateParameters. +func (srdcup SQLRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srdcup.SQLRoleDefinitionResource != nil { + objectMap["properties"] = srdcup.SQLRoleDefinitionResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionCreateUpdateParameters struct. +func (srdcup *SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleDefinitionResource SQLRoleDefinitionResource + err = json.Unmarshal(*v, &SQLRoleDefinitionResource) + if err != nil { + return err + } + srdcup.SQLRoleDefinitionResource = &SQLRoleDefinitionResource + } + } + } + + return nil +} + +// SQLRoleDefinitionGetResults an Azure Cosmos DB SQL Role Definition. +type SQLRoleDefinitionGetResults struct { + autorest.Response `json:"-"` + // SQLRoleDefinitionResource - Properties related to the Role Definition. + *SQLRoleDefinitionResource `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionGetResults. +func (srdgr SQLRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srdgr.SQLRoleDefinitionResource != nil { + objectMap["properties"] = srdgr.SQLRoleDefinitionResource + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionGetResults struct. +func (srdgr *SQLRoleDefinitionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLRoleDefinitionResource SQLRoleDefinitionResource + err = json.Unmarshal(*v, &SQLRoleDefinitionResource) + if err != nil { + return err + } + srdgr.SQLRoleDefinitionResource = &SQLRoleDefinitionResource + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + srdgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + srdgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + srdgr.Type = &typeVar + } + } + } + + return nil +} + +// SQLRoleDefinitionListResult the relevant Role Definitions. +type SQLRoleDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Role Definitions and their properties. + Value *[]SQLRoleDefinitionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLRoleDefinitionListResult. +func (srdlr SQLRoleDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLRoleDefinitionResource azure Cosmos DB SQL Role Definition resource object. +type SQLRoleDefinitionResource struct { + // RoleName - A user-friendly name for the Role Definition. Must be unique for the database account. + RoleName *string `json:"roleName,omitempty"` + // Type - Indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole' + Type RoleDefinitionType `json:"type,omitempty"` + // AssignableScopes - A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + AssignableScopes *[]string `json:"assignableScopes,omitempty"` + // Permissions - The set of operations allowed through this Role Definition. + Permissions *[]Permission `json:"permissions,omitempty"` +} + +// SQLStoredProcedureCreateUpdateParameters parameters to create and update Cosmos DB storedProcedure. +type SQLStoredProcedureCreateUpdateParameters struct { + // SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure. + *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureCreateUpdateParameters. +func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspcup.SQLStoredProcedureCreateUpdateProperties != nil { + objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties + } + if sspcup.Location != nil { + objectMap["location"] = sspcup.Location + } + if sspcup.Tags != nil { + objectMap["tags"] = sspcup.Tags + } + if sspcup.Identity != nil { + objectMap["identity"] = sspcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureCreateUpdateParameters struct. +func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties + err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties) + if err != nil { + return err + } + sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sspcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sspcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sspcup.Identity = &identity + } + } + } + + return nil +} + +// SQLStoredProcedureCreateUpdateProperties properties to create and update Azure Cosmos DB +// storedProcedure. +type SQLStoredProcedureCreateUpdateProperties struct { + // Resource - The standard JSON format of a storedProcedure + Resource *SQLStoredProcedureResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLStoredProcedureGetProperties the properties of an Azure Cosmos DB StoredProcedure +type SQLStoredProcedureGetProperties struct { + Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLStoredProcedureGetPropertiesResource ... +type SQLStoredProcedureGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL storedProcedure + ID *string `json:"id,omitempty"` + // Body - Body of the Stored Procedure + Body *string `json:"body,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureGetPropertiesResource. +func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspgp.ID != nil { + objectMap["id"] = sspgp.ID + } + if sspgp.Body != nil { + objectMap["body"] = sspgp.Body + } + return json.Marshal(objectMap) +} + +// SQLStoredProcedureGetResults an Azure Cosmos DB storedProcedure. +type SQLStoredProcedureGetResults struct { + autorest.Response `json:"-"` + // SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB storedProcedure + *SQLStoredProcedureGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureGetResults. +func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspgr.SQLStoredProcedureGetProperties != nil { + objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties + } + if sspgr.Location != nil { + objectMap["location"] = sspgr.Location + } + if sspgr.Tags != nil { + objectMap["tags"] = sspgr.Tags + } + if sspgr.Identity != nil { + objectMap["identity"] = sspgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureGetResults struct. +func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties + err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties) + if err != nil { + return err + } + sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sspgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sspgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sspgr.Identity = &identity + } + } + } + + return nil +} + +// SQLStoredProcedureListResult the List operation response, that contains the storedProcedures and their +// properties. +type SQLStoredProcedureListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of storedProcedures and their properties. + Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLStoredProcedureListResult. +func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLStoredProcedureResource cosmos DB SQL storedProcedure resource object +type SQLStoredProcedureResource struct { + // ID - Name of the Cosmos DB SQL storedProcedure + ID *string `json:"id,omitempty"` + // Body - Body of the Stored Procedure + Body *string `json:"body,omitempty"` +} + +// SQLTriggerCreateUpdateParameters parameters to create and update Cosmos DB trigger. +type SQLTriggerCreateUpdateParameters struct { + // SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger. + *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerCreateUpdateParameters. +func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stcup.SQLTriggerCreateUpdateProperties != nil { + objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties + } + if stcup.Location != nil { + objectMap["location"] = stcup.Location + } + if stcup.Tags != nil { + objectMap["tags"] = stcup.Tags + } + if stcup.Identity != nil { + objectMap["identity"] = stcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLTriggerCreateUpdateParameters struct. +func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties + err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties) + if err != nil { + return err + } + stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + stcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + stcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + stcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + stcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + stcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + stcup.Identity = &identity + } + } + } + + return nil +} + +// SQLTriggerCreateUpdateProperties properties to create and update Azure Cosmos DB trigger. +type SQLTriggerCreateUpdateProperties struct { + // Resource - The standard JSON format of a trigger + Resource *SQLTriggerResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLTriggerGetProperties the properties of an Azure Cosmos DB trigger +type SQLTriggerGetProperties struct { + Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLTriggerGetPropertiesResource ... +type SQLTriggerGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL trigger + ID *string `json:"id,omitempty"` + // Body - Body of the Trigger + Body *string `json:"body,omitempty"` + // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' + TriggerType TriggerType `json:"triggerType,omitempty"` + // TriggerOperation - The operation the trigger is associated with. Possible values include: 'TriggerOperationAll', 'TriggerOperationCreate', 'TriggerOperationUpdate', 'TriggerOperationDelete', 'TriggerOperationReplace' + TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerGetPropertiesResource. +func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stgp.ID != nil { + objectMap["id"] = stgp.ID + } + if stgp.Body != nil { + objectMap["body"] = stgp.Body + } + if stgp.TriggerType != "" { + objectMap["triggerType"] = stgp.TriggerType + } + if stgp.TriggerOperation != "" { + objectMap["triggerOperation"] = stgp.TriggerOperation + } + return json.Marshal(objectMap) +} + +// SQLTriggerGetResults an Azure Cosmos DB trigger. +type SQLTriggerGetResults struct { + autorest.Response `json:"-"` + // SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger + *SQLTriggerGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerGetResults. +func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stgr.SQLTriggerGetProperties != nil { + objectMap["properties"] = stgr.SQLTriggerGetProperties + } + if stgr.Location != nil { + objectMap["location"] = stgr.Location + } + if stgr.Tags != nil { + objectMap["tags"] = stgr.Tags + } + if stgr.Identity != nil { + objectMap["identity"] = stgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLTriggerGetResults struct. +func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLTriggerGetProperties SQLTriggerGetProperties + err = json.Unmarshal(*v, &SQLTriggerGetProperties) + if err != nil { + return err + } + stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + stgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + stgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + stgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + stgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + stgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + stgr.Identity = &identity + } + } + } + + return nil +} + +// SQLTriggerListResult the List operation response, that contains the triggers and their properties. +type SQLTriggerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of triggers and their properties. + Value *[]SQLTriggerGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLTriggerListResult. +func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLTriggerResource cosmos DB SQL trigger resource object +type SQLTriggerResource struct { + // ID - Name of the Cosmos DB SQL trigger + ID *string `json:"id,omitempty"` + // Body - Body of the Trigger + Body *string `json:"body,omitempty"` + // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' + TriggerType TriggerType `json:"triggerType,omitempty"` + // TriggerOperation - The operation the trigger is associated with. Possible values include: 'TriggerOperationAll', 'TriggerOperationCreate', 'TriggerOperationUpdate', 'TriggerOperationDelete', 'TriggerOperationReplace' + TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` +} + +// SQLUserDefinedFunctionCreateUpdateParameters parameters to create and update Cosmos DB +// userDefinedFunction. +type SQLUserDefinedFunctionCreateUpdateParameters struct { + // SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction. + *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionCreateUpdateParameters. +func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil { + objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties + } + if sudfcup.Location != nil { + objectMap["location"] = sudfcup.Location + } + if sudfcup.Tags != nil { + objectMap["tags"] = sudfcup.Tags + } + if sudfcup.Identity != nil { + objectMap["identity"] = sudfcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionCreateUpdateParameters struct. +func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties + err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties) + if err != nil { + return err + } + sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sudfcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sudfcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sudfcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sudfcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sudfcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sudfcup.Identity = &identity + } + } + } + + return nil +} + +// SQLUserDefinedFunctionCreateUpdateProperties properties to create and update Azure Cosmos DB +// userDefinedFunction. +type SQLUserDefinedFunctionCreateUpdateProperties struct { + // Resource - The standard JSON format of a userDefinedFunction + Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// SQLUserDefinedFunctionGetProperties the properties of an Azure Cosmos DB userDefinedFunction +type SQLUserDefinedFunctionGetProperties struct { + Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"` +} + +// SQLUserDefinedFunctionGetPropertiesResource ... +type SQLUserDefinedFunctionGetPropertiesResource struct { + // ID - Name of the Cosmos DB SQL userDefinedFunction + ID *string `json:"id,omitempty"` + // Body - Body of the User Defined Function + Body *string `json:"body,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetPropertiesResource. +func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfgp.ID != nil { + objectMap["id"] = sudfgp.ID + } + if sudfgp.Body != nil { + objectMap["body"] = sudfgp.Body + } + return json.Marshal(objectMap) +} + +// SQLUserDefinedFunctionGetResults an Azure Cosmos DB userDefinedFunction. +type SQLUserDefinedFunctionGetResults struct { + autorest.Response `json:"-"` + // SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction + *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetResults. +func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sudfgr.SQLUserDefinedFunctionGetProperties != nil { + objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties + } + if sudfgr.Location != nil { + objectMap["location"] = sudfgr.Location + } + if sudfgr.Tags != nil { + objectMap["tags"] = sudfgr.Tags + } + if sudfgr.Identity != nil { + objectMap["identity"] = sudfgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionGetResults struct. +func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties + err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties) + if err != nil { + return err + } + sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sudfgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sudfgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sudfgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sudfgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sudfgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sudfgr.Identity = &identity + } + } + } + + return nil +} + +// SQLUserDefinedFunctionListResult the List operation response, that contains the userDefinedFunctions and +// their properties. +type SQLUserDefinedFunctionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of userDefinedFunctions and their properties. + Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionListResult. +func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SQLUserDefinedFunctionResource cosmos DB SQL userDefinedFunction resource object +type SQLUserDefinedFunctionResource struct { + // ID - Name of the Cosmos DB SQL userDefinedFunction + ID *string `json:"id,omitempty"` + // Body - Body of the User Defined Function + Body *string `json:"body,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TableCreateUpdateParameters parameters to create and update Cosmos DB Table. +type TableCreateUpdateParameters struct { + // TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table. + *TableCreateUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableCreateUpdateParameters. +func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcup.TableCreateUpdateProperties != nil { + objectMap["properties"] = tcup.TableCreateUpdateProperties + } + if tcup.Location != nil { + objectMap["location"] = tcup.Location + } + if tcup.Tags != nil { + objectMap["tags"] = tcup.Tags + } + if tcup.Identity != nil { + objectMap["identity"] = tcup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TableCreateUpdateParameters struct. +func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tableCreateUpdateProperties TableCreateUpdateProperties + err = json.Unmarshal(*v, &tableCreateUpdateProperties) + if err != nil { + return err + } + tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tcup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tcup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tcup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tcup.Identity = &identity + } + } + } + + return nil +} + +// TableCreateUpdateProperties properties to create and update Azure Cosmos DB Table. +type TableCreateUpdateProperties struct { + // Resource - The standard JSON format of a Table + Resource *TableResource `json:"resource,omitempty"` + // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// TableGetProperties the properties of an Azure Cosmos Table +type TableGetProperties struct { + Resource *TableGetPropertiesResource `json:"resource,omitempty"` + Options *TableGetPropertiesOptions `json:"options,omitempty"` +} + +// TableGetPropertiesOptions ... +type TableGetPropertiesOptions struct { + // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` +} + +// TableGetPropertiesResource ... +type TableGetPropertiesResource struct { + // ID - Name of the Cosmos DB table + ID *string `json:"id,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableGetPropertiesResource. +func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tgp.ID != nil { + objectMap["id"] = tgp.ID + } + return json.Marshal(objectMap) +} + +// TableGetResults an Azure Cosmos DB Table. +type TableGetResults struct { + autorest.Response `json:"-"` + // TableGetProperties - The properties of an Azure Cosmos DB Table + *TableGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableGetResults. +func (tgr TableGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tgr.TableGetProperties != nil { + objectMap["properties"] = tgr.TableGetProperties + } + if tgr.Location != nil { + objectMap["location"] = tgr.Location + } + if tgr.Tags != nil { + objectMap["tags"] = tgr.Tags + } + if tgr.Identity != nil { + objectMap["identity"] = tgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TableGetResults struct. +func (tgr *TableGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tableGetProperties TableGetProperties + err = json.Unmarshal(*v, &tableGetProperties) + if err != nil { + return err + } + tgr.TableGetProperties = &tableGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tgr.Identity = &identity + } + } + } + + return nil +} + +// TableListResult the List operation response, that contains the Table and their properties. +type TableListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Table and their properties. + Value *[]TableGetResults `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableListResult. +func (tlr TableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TableResource cosmos DB table resource object +type TableResource struct { + // ID - Name of the Cosmos DB table + ID *string `json:"id,omitempty"` +} + +// TableResourcesCreateUpdateTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesCreateUpdateTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (TableGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesCreateUpdateTableFuture.Result. +func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent { + tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesDeleteTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesDeleteTableFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesDeleteTableFuture.Result. +func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture") + return + } + ar.Response = future.Response() + return +} + +// TableResourcesMigrateTableToAutoscaleFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type TableResourcesMigrateTableToAutoscaleFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesMigrateTableToAutoscaleFuture.Result. +func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesMigrateTableToManualThroughputFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type TableResourcesMigrateTableToManualThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesMigrateTableToManualThroughputFuture.Result. +func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// TableResourcesUpdateTableThroughputFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type TableResourcesUpdateTableThroughputFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TableResourcesUpdateTableThroughputFuture.Result. +func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tsgr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { + tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") + } + } + return +} + +// ThroughputPolicyResource cosmos DB resource throughput policy +type ThroughputPolicyResource struct { + // IsEnabled - Determines whether the ThroughputPolicy is active or not + IsEnabled *bool `json:"isEnabled,omitempty"` + // IncrementPercent - Represents the percentage by which throughput can increase every time throughput policy kicks in. + IncrementPercent *int32 `json:"incrementPercent,omitempty"` +} + +// ThroughputSettingsGetProperties the properties of an Azure Cosmos DB resource throughput +type ThroughputSettingsGetProperties struct { + Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"` +} + +// ThroughputSettingsGetPropertiesResource ... +type ThroughputSettingsGetPropertiesResource struct { + // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. + AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` + // MinimumThroughput - READ-ONLY; The minimum throughput of the resource + MinimumThroughput *string `json:"minimumThroughput,omitempty"` + // OfferReplacePending - READ-ONLY; The throughput replace is pending + OfferReplacePending *string `json:"offerReplacePending,omitempty"` + // Rid - READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty"` + // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float64 `json:"_ts,omitempty"` + // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsGetPropertiesResource. +func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsgp.Throughput != nil { + objectMap["throughput"] = tsgp.Throughput + } + if tsgp.AutoscaleSettings != nil { + objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings + } + return json.Marshal(objectMap) +} + +// ThroughputSettingsGetResults an Azure Cosmos DB resource throughput. +type ThroughputSettingsGetResults struct { + autorest.Response `json:"-"` + // ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput + *ThroughputSettingsGetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsGetResults. +func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsgr.ThroughputSettingsGetProperties != nil { + objectMap["properties"] = tsgr.ThroughputSettingsGetProperties + } + if tsgr.Location != nil { + objectMap["location"] = tsgr.Location + } + if tsgr.Tags != nil { + objectMap["tags"] = tsgr.Tags + } + if tsgr.Identity != nil { + objectMap["identity"] = tsgr.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsGetResults struct. +func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var throughputSettingsGetProperties ThroughputSettingsGetProperties + err = json.Unmarshal(*v, &throughputSettingsGetProperties) + if err != nil { + return err + } + tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tsgr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tsgr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tsgr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tsgr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tsgr.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tsgr.Identity = &identity + } + } + } + + return nil +} + +// ThroughputSettingsResource cosmos DB resource throughput object. Either throughput is required or +// autoscaleSettings is required, but not both. +type ThroughputSettingsResource struct { + // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. + Throughput *int32 `json:"throughput,omitempty"` + // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. + AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` + // MinimumThroughput - READ-ONLY; The minimum throughput of the resource + MinimumThroughput *string `json:"minimumThroughput,omitempty"` + // OfferReplacePending - READ-ONLY; The throughput replace is pending + OfferReplacePending *string `json:"offerReplacePending,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsResource. +func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsr.Throughput != nil { + objectMap["throughput"] = tsr.Throughput + } + if tsr.AutoscaleSettings != nil { + objectMap["autoscaleSettings"] = tsr.AutoscaleSettings + } + return json.Marshal(objectMap) +} + +// ThroughputSettingsUpdateParameters parameters to update Cosmos DB resource throughput. +type ThroughputSettingsUpdateParameters struct { + // ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput. + *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ThroughputSettingsUpdateParameters. +func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsup.ThroughputSettingsUpdateProperties != nil { + objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties + } + if tsup.Location != nil { + objectMap["location"] = tsup.Location + } + if tsup.Tags != nil { + objectMap["tags"] = tsup.Tags + } + if tsup.Identity != nil { + objectMap["identity"] = tsup.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsUpdateParameters struct. +func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties + err = json.Unmarshal(*v, &throughputSettingsUpdateProperties) + if err != nil { + return err + } + tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tsup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tsup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tsup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tsup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tsup.Tags = tags + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tsup.Identity = &identity + } + } + } + + return nil +} + +// ThroughputSettingsUpdateProperties properties to update Azure Cosmos DB resource throughput. +type ThroughputSettingsUpdateProperties struct { + // Resource - The standard JSON format of a resource throughput + Resource *ThroughputSettingsResource `json:"resource,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UniqueKey the unique key on that enforces uniqueness constraint on documents in the collection in the +// Azure Cosmos DB service. +type UniqueKey struct { + // Paths - List of paths must be unique for each document in the Azure Cosmos DB service + Paths *[]string `json:"paths,omitempty"` +} + +// UniqueKeyPolicy the unique key policy configuration for specifying uniqueness constraints on documents +// in the collection in the Azure Cosmos DB service. +type UniqueKeyPolicy struct { + // UniqueKeys - List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"` +} + +// Usage the usage data for a usage request. +type Usage struct { + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - READ-ONLY; The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // Limit - READ-ONLY; Maximum value for this metric + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - READ-ONLY; Current value for this metric + CurrentValue *int64 `json:"currentValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Unit != "" { + objectMap["unit"] = u.Unit + } + return json.Marshal(objectMap) +} + +// UsagesResult the response to a list usage request. +type UsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric + Value *[]Usage `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsagesResult. +func (ur UsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualNetworkRule virtual Network ACL Rule object +type VirtualNetworkRule struct { + // ID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + ID *string `json:"id,omitempty"` + // IgnoreMissingVNetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. + IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"` +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/mongodbresources.go new file mode 100644 index 000000000000..ce01f275411e --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/mongodbresources.go @@ -0,0 +1,1573 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MongoDBResourcesClient is the client for the MongoDBResources methods of the Documentdb service. +type MongoDBResourcesClient struct { + BaseClient +} + +// NewMongoDBResourcesClient creates an instance of the MongoDBResourcesClient client. +func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { + return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMongoDBResourcesClientWithBaseURI creates an instance of the MongoDBResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { + return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateMongoDBCollection create or update an Azure Cosmos DB MongoDB Collection +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +// createUpdateMongoDBCollectionParameters - the parameters to provide for the current MongoDB Collection. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.CreateUpdateMongoDBCollection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateMongoDBCollectionParameters, + Constraints: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBCollectionParameters.MongoDBCollectionCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", err.Error()) + } + + req, err := client.CreateUpdateMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateMongoDBCollectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBCollection", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateMongoDBCollectionPreparer prepares the CreateUpdateMongoDBCollection request. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithJSON(createUpdateMongoDBCollectionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateMongoDBCollectionSender sends the CreateUpdateMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionSender(req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBCollectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateMongoDBCollectionResponder handles the response to the CreateUpdateMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionResponder(resp *http.Response) (result MongoDBCollectionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateMongoDBDatabase create or updates Azure Cosmos DB MongoDB database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateMongoDBDatabaseParameters - the parameters to provide for the current MongoDB database. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters) (result MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.CreateUpdateMongoDBDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateMongoDBDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateMongoDBDatabaseParameters.MongoDBDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", err.Error()) + } + + req, err := client.CreateUpdateMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateMongoDBDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "CreateUpdateMongoDBDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateMongoDBDatabasePreparer prepares the CreateUpdateMongoDBDatabase request. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateMongoDBDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateMongoDBDatabaseSender sends the CreateUpdateMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabaseSender(req *http.Request) (future MongoDBResourcesCreateUpdateMongoDBDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateMongoDBDatabaseResponder handles the response to the CreateUpdateMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabaseResponder(resp *http.Response) (result MongoDBDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteMongoDBCollection deletes an existing Azure Cosmos DB MongoDB Collection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesDeleteMongoDBCollectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.DeleteMongoDBCollection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", err.Error()) + } + + req, err := client.DeleteMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", nil, "Failure preparing request") + return + } + + result, err = client.DeleteMongoDBCollectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBCollection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteMongoDBCollectionPreparer prepares the DeleteMongoDBCollection request. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteMongoDBCollectionSender sends the DeleteMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionSender(req *http.Request) (future MongoDBResourcesDeleteMongoDBCollectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteMongoDBCollectionResponder handles the response to the DeleteMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) DeleteMongoDBCollectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteMongoDBDatabase deletes an existing Azure Cosmos DB MongoDB database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.DeleteMongoDBDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", err.Error()) + } + + req, err := client.DeleteMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteMongoDBDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "DeleteMongoDBDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteMongoDBDatabasePreparer prepares the DeleteMongoDBDatabase request. +func (client MongoDBResourcesClient) DeleteMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteMongoDBDatabaseSender sends the DeleteMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) DeleteMongoDBDatabaseSender(req *http.Request) (future MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteMongoDBDatabaseResponder handles the response to the DeleteMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) DeleteMongoDBDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetMongoDBCollection gets the MongoDB collection under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBCollectionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBCollection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBCollection", err.Error()) + } + + req, err := client.GetMongoDBCollectionPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBCollectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBCollectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollection", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBCollectionPreparer prepares the GetMongoDBCollection request. +func (client MongoDBResourcesClient) GetMongoDBCollectionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBCollectionSender sends the GetMongoDBCollection request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBCollectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBCollectionResponder handles the response to the GetMongoDBCollection request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBCollectionResponder(resp *http.Response) (result MongoDBCollectionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBCollectionThroughput gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBCollectionThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", err.Error()) + } + + req, err := client.GetMongoDBCollectionThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBCollectionThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBCollectionThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBCollectionThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBCollectionThroughputPreparer prepares the GetMongoDBCollectionThroughput request. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBCollectionThroughputSender sends the GetMongoDBCollectionThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBCollectionThroughputResponder handles the response to the GetMongoDBCollectionThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBDatabase gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided +// name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", err.Error()) + } + + req, err := client.GetMongoDBDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBDatabasePreparer prepares the GetMongoDBDatabase request. +func (client MongoDBResourcesClient) GetMongoDBDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBDatabaseSender sends the GetMongoDBDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBDatabaseResponder handles the response to the GetMongoDBDatabase request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBDatabaseResponder(resp *http.Response) (result MongoDBDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMongoDBDatabaseThroughput gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB +// database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.GetMongoDBDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", err.Error()) + } + + req, err := client.GetMongoDBDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetMongoDBDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetMongoDBDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "GetMongoDBDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetMongoDBDatabaseThroughputPreparer prepares the GetMongoDBDatabaseThroughput request. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMongoDBDatabaseThroughputSender sends the GetMongoDBDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMongoDBDatabaseThroughputResponder handles the response to the GetMongoDBDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMongoDBCollections lists the MongoDB collection under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBCollectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.ListMongoDBCollections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "ListMongoDBCollections", err.Error()) + } + + req, err := client.ListMongoDBCollectionsPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", nil, "Failure preparing request") + return + } + + resp, err := client.ListMongoDBCollectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", resp, "Failure sending request") + return + } + + result, err = client.ListMongoDBCollectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBCollections", resp, "Failure responding to request") + return + } + + return +} + +// ListMongoDBCollectionsPreparer prepares the ListMongoDBCollections request. +func (client MongoDBResourcesClient) ListMongoDBCollectionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMongoDBCollectionsSender sends the ListMongoDBCollections request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) ListMongoDBCollectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMongoDBCollectionsResponder handles the response to the ListMongoDBCollections request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) ListMongoDBCollectionsResponder(resp *http.Response) (result MongoDBCollectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMongoDBDatabases lists the MongoDB databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, resourceGroupName string, accountName string) (result MongoDBDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.ListMongoDBDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", err.Error()) + } + + req, err := client.ListMongoDBDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListMongoDBDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListMongoDBDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "ListMongoDBDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListMongoDBDatabasesPreparer prepares the ListMongoDBDatabases request. +func (client MongoDBResourcesClient) ListMongoDBDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMongoDBDatabasesSender sends the ListMongoDBDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) ListMongoDBDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMongoDBDatabasesResponder handles the response to the ListMongoDBDatabases request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) ListMongoDBDatabasesResponder(resp *http.Response) (result MongoDBDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBCollectionToAutoscale migrate an Azure Cosmos DB MongoDB collection from manual throughput to +// autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBCollectionToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", err.Error()) + } + + req, err := client.MigrateMongoDBCollectionToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBCollectionToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBCollectionToAutoscalePreparer prepares the MigrateMongoDBCollectionToAutoscale request. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBCollectionToAutoscaleSender sends the MigrateMongoDBCollectionToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscaleSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBCollectionToAutoscaleResponder handles the response to the MigrateMongoDBCollectionToAutoscale request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBCollectionToManualThroughput migrate an Azure Cosmos DB MongoDB collection from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (result MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBCollectionToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", err.Error()) + } + + req, err := client.MigrateMongoDBCollectionToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBCollectionToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBCollectionToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBCollectionToManualThroughputPreparer prepares the MigrateMongoDBCollectionToManualThroughput request. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBCollectionToManualThroughputSender sends the MigrateMongoDBCollectionToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBCollectionToManualThroughputResponder handles the response to the MigrateMongoDBCollectionToManualThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBCollectionToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBDatabaseToAutoscale migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateMongoDBDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBDatabaseToAutoscalePreparer prepares the MigrateMongoDBDatabaseToAutoscale request. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBDatabaseToAutoscaleSender sends the MigrateMongoDBDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscaleSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBDatabaseToAutoscaleResponder handles the response to the MigrateMongoDBDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateMongoDBDatabaseToManualThroughput migrate an Azure Cosmos DB MongoDB database from autoscale to manual +// throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.MigrateMongoDBDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateMongoDBDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMongoDBDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "MigrateMongoDBDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMongoDBDatabaseToManualThroughputPreparer prepares the MigrateMongoDBDatabaseToManualThroughput request. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMongoDBDatabaseToManualThroughputSender sends the MigrateMongoDBDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputSender(req *http.Request) (future MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMongoDBDatabaseToManualThroughputResponder handles the response to the MigrateMongoDBDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) MigrateMongoDBDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMongoDBCollectionThroughput update the RUs per second of an Azure Cosmos DB MongoDB collection +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// collectionName - cosmos DB collection name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current MongoDB +// collection. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.UpdateMongoDBCollectionThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", err.Error()) + } + + req, err := client.UpdateMongoDBCollectionThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMongoDBCollectionThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBCollectionThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMongoDBCollectionThroughputPreparer prepares the UpdateMongoDBCollectionThroughput request. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionName": autorest.Encode("path", collectionName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMongoDBCollectionThroughputSender sends the UpdateMongoDBCollectionThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputSender(req *http.Request) (future MongoDBResourcesUpdateMongoDBCollectionThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMongoDBCollectionThroughputResponder handles the response to the UpdateMongoDBCollectionThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMongoDBDatabaseThroughput update RUs per second of the an Azure Cosmos DB MongoDB database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the RUs per second of the parameters to provide for the current MongoDB +// database. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MongoDBResourcesClient.UpdateMongoDBDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateMongoDBDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateMongoDBDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesClient", "UpdateMongoDBDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateMongoDBDatabaseThroughputPreparer prepares the UpdateMongoDBDatabaseThroughput request. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMongoDBDatabaseThroughputSender sends the UpdateMongoDBDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputSender(req *http.Request) (future MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateMongoDBDatabaseThroughputResponder handles the response to the UpdateMongoDBDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/notebookworkspaces.go new file mode 100644 index 000000000000..818bcb74fa02 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/notebookworkspaces.go @@ -0,0 +1,674 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NotebookWorkspacesClient is the client for the NotebookWorkspaces methods of the Documentdb service. +type NotebookWorkspacesClient struct { + BaseClient +} + +// NewNotebookWorkspacesClient creates an instance of the NotebookWorkspacesClient client. +func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { + return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotebookWorkspacesClientWithBaseURI creates an instance of the NotebookWorkspacesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { + return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// notebookCreateUpdateParameters - the notebook workspace to create for the current database account. +func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, notebookCreateUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotebookWorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithJSON(notebookCreateUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) CreateOrUpdateSender(req *http.Request) (future NotebookWorkspacesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result NotebookWorkspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NotebookWorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) DeleteSender(req *http.Request) (future NotebookWorkspacesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the notebook workspace for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client NotebookWorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result NotebookWorkspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client NotebookWorkspacesClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http.Response) (result NotebookWorkspaceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionInfo retrieves the connection info for the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.ListConnectionInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "ListConnectionInfo", err.Error()) + } + + req, err := client.ListConnectionInfoPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "ListConnectionInfo", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionInfoPreparer prepares the ListConnectionInfo request. +func (client NotebookWorkspacesClient) ListConnectionInfoPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionInfoSender sends the ListConnectionInfo request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) ListConnectionInfoSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionInfoResponder handles the response to the ListConnectionInfo request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Response) (result NotebookWorkspaceConnectionInfoResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateAuthToken regenerates the auth token for the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.RegenerateAuthToken") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", err.Error()) + } + + req, err := client.RegenerateAuthTokenPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", nil, "Failure preparing request") + return + } + + result, err = client.RegenerateAuthTokenSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "RegenerateAuthToken", result.Response(), "Failure sending request") + return + } + + return +} + +// RegenerateAuthTokenPreparer prepares the RegenerateAuthToken request. +func (client NotebookWorkspacesClient) RegenerateAuthTokenPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateAuthTokenSender sends the RegenerateAuthToken request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) RegenerateAuthTokenSender(req *http.Request) (future NotebookWorkspacesRegenerateAuthTokenFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegenerateAuthTokenResponder handles the response to the RegenerateAuthToken request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts the notebook workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebookWorkspacesClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.NotebookWorkspacesClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client NotebookWorkspacesClient) StartPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "notebookWorkspaceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client NotebookWorkspacesClient) StartSender(req *http.Request) (future NotebookWorkspacesStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client NotebookWorkspacesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/operations.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/operations.go new file mode 100644 index 000000000000..64ca3475a623 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/operations.go @@ -0,0 +1,140 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Documentdb service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Cosmos DB Resource Provider operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DocumentDB/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeid.go new file mode 100644 index 000000000000..60139a3a3637 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeid.go @@ -0,0 +1,132 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PartitionKeyRangeIDClient is the client for the PartitionKeyRangeID methods of the Documentdb service. +type PartitionKeyRangeIDClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDClient creates an instance of the PartitionKeyRangeIDClient client. +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDClientWithBaseURI creates an instance of the PartitionKeyRangeIDClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// partitionKeyRangeID - partition Key Range Id for which to get data. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PartitionKeyRangeIDClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeidregion.go new file mode 100644 index 000000000000..89795e70a487 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/partitionkeyrangeidregion.go @@ -0,0 +1,134 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PartitionKeyRangeIDRegionClient is the client for the PartitionKeyRangeIDRegion methods of the Documentdb service. +type PartitionKeyRangeIDRegionClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDRegionClient creates an instance of the PartitionKeyRangeIDRegionClient client. +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDRegionClientWithBaseURI creates an instance of the PartitionKeyRangeIDRegionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id and region. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// region - cosmos DB region, with spaces between words and each word capitalized. +// databaseRid - cosmos DB database rid. +// collectionRid - cosmos DB collection rid. +// partitionKeyRangeID - partition Key Range Id for which to get data. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PartitionKeyRangeIDRegionClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentile.go new file mode 100644 index 000000000000..956c11f14e3c --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentile.go @@ -0,0 +1,126 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileClient is the client for the Percentile methods of the Documentdb service. +type PercentileClient struct { + BaseClient +} + +// NewPercentileClient creates an instance of the PercentileClient client. +func NewPercentileClient(subscriptionID string) PercentileClient { + return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileClientWithBaseURI creates an instance of the PercentileClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return PercentileClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account. This url is only +// for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentilesourcetarget.go new file mode 100644 index 000000000000..3aaac6d8ffc1 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentilesourcetarget.go @@ -0,0 +1,133 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileSourceTargetClient is the client for the PercentileSourceTarget methods of the Documentdb service. +type PercentileSourceTargetClient struct { + BaseClient +} + +// NewPercentileSourceTargetClient creates an instance of the PercentileSourceTargetClient client. +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileSourceTargetClientWithBaseURI creates an instance of the PercentileSourceTargetClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account, source and target region. +// This url is only for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// sourceRegion - source region from which data is written. Cosmos DB region, with spaces between words and +// each word capitalized. +// targetRegion - target region to which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileSourceTargetClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileSourceTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, sourceRegion, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileSourceTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceRegion": autorest.Encode("path", sourceRegion), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileSourceTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileSourceTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentiletarget.go new file mode 100644 index 000000000000..6fc06a41ef80 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/percentiletarget.go @@ -0,0 +1,130 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PercentileTargetClient is the client for the PercentileTarget methods of the Documentdb service. +type PercentileTargetClient struct { + BaseClient +} + +// NewPercentileTargetClient creates an instance of the PercentileTargetClient client. +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileTargetClientWithBaseURI creates an instance of the PercentileTargetClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account target region. This url is +// only for PBS and Replication Latency data +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// targetRegion - target region to which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. +// filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PercentileTargetClient.ListMetrics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure responding to request") + return + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privateendpointconnections.go new file mode 100644 index 000000000000..13ffc7bdf6b8 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privateendpointconnections.go @@ -0,0 +1,402 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the client for the PrivateEndpointConnections methods of the Documentdb service. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate approve or reject a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount list all private endpoint connections on a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateEndpointConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListByDatabaseAccountResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privatelinkresources.go new file mode 100644 index 000000000000..ea2ecccd9576 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/privatelinkresources.go @@ -0,0 +1,213 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the client for the PrivateLinkResources methods of the Documentdb service. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the private link resources that need to be created for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// groupName - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "groupName": autorest.Encode("path", groupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabaseAccount gets the private link resources that need to be created for a Cosmos DB account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByDatabaseAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", err.Error()) + } + + req, err := client.ListByDatabaseAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PrivateLinkResourcesClient", "ListByDatabaseAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabaseAccountPreparer prepares the ListByDatabaseAccount request. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseAccountSender sends the ListByDatabaseAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseAccountResponder handles the response to the ListByDatabaseAccount request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByDatabaseAccountResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorabledatabaseaccounts.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorabledatabaseaccounts.go new file mode 100644 index 000000000000..3cc424e6c543 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorabledatabaseaccounts.go @@ -0,0 +1,275 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableDatabaseAccountsClient is the client for the RestorableDatabaseAccounts methods of the Documentdb service. +type RestorableDatabaseAccountsClient struct { + BaseClient +} + +// NewRestorableDatabaseAccountsClient creates an instance of the RestorableDatabaseAccountsClient client. +func NewRestorableDatabaseAccountsClient(subscriptionID string) RestorableDatabaseAccountsClient { + return NewRestorableDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableDatabaseAccountsClientWithBaseURI creates an instance of the RestorableDatabaseAccountsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewRestorableDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) RestorableDatabaseAccountsClient { + return RestorableDatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByLocation retrieves the properties of an existing Azure Cosmos DB restorable database account. This call +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +func (client RestorableDatabaseAccountsClient) GetByLocation(ctx context.Context, location string, instanceID string) (result RestorableDatabaseAccountGetResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDatabaseAccountsClient.GetByLocation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableDatabaseAccountsClient", "GetByLocation", err.Error()) + } + + req, err := client.GetByLocationPreparer(ctx, location, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "GetByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.GetByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "GetByLocation", resp, "Failure sending request") + return + } + + result, err = client.GetByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "GetByLocation", resp, "Failure responding to request") + return + } + + return +} + +// GetByLocationPreparer prepares the GetByLocation request. +func (client RestorableDatabaseAccountsClient) GetByLocationPreparer(ctx context.Context, location string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByLocationSender sends the GetByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableDatabaseAccountsClient) GetByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByLocationResponder handles the response to the GetByLocation request. The method always +// closes the http.Response Body. +func (client RestorableDatabaseAccountsClient) GetByLocationResponder(resp *http.Response) (result RestorableDatabaseAccountGetResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. +func (client RestorableDatabaseAccountsClient) List(ctx context.Context) (result RestorableDatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDatabaseAccountsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableDatabaseAccountsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableDatabaseAccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableDatabaseAccountsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableDatabaseAccountsClient) ListResponder(resp *http.Response) (result RestorableDatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByLocation lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a +// region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +func (client RestorableDatabaseAccountsClient) ListByLocation(ctx context.Context, location string) (result RestorableDatabaseAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDatabaseAccountsClient.ListByLocation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableDatabaseAccountsClient", "ListByLocation", err.Error()) + } + + req, err := client.ListByLocationPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "ListByLocation", resp, "Failure sending request") + return + } + + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableDatabaseAccountsClient", "ListByLocation", resp, "Failure responding to request") + return + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client RestorableDatabaseAccountsClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableDatabaseAccountsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client RestorableDatabaseAccountsClient) ListByLocationResponder(resp *http.Response) (result RestorableDatabaseAccountsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbcollections.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbcollections.go new file mode 100644 index 000000000000..a02aaf04510e --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbcollections.go @@ -0,0 +1,122 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableMongodbCollectionsClient is the client for the RestorableMongodbCollections methods of the Documentdb +// service. +type RestorableMongodbCollectionsClient struct { + BaseClient +} + +// NewRestorableMongodbCollectionsClient creates an instance of the RestorableMongodbCollectionsClient client. +func NewRestorableMongodbCollectionsClient(subscriptionID string) RestorableMongodbCollectionsClient { + return NewRestorableMongodbCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableMongodbCollectionsClientWithBaseURI creates an instance of the RestorableMongodbCollectionsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewRestorableMongodbCollectionsClientWithBaseURI(baseURI string, subscriptionID string) RestorableMongodbCollectionsClient { + return RestorableMongodbCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific +// database. This helps in scenario where container was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +// restorableMongodbDatabaseRid - the resource ID of the MongoDB database. +func (client RestorableMongodbCollectionsClient) List(ctx context.Context, location string, instanceID string, restorableMongodbDatabaseRid string) (result RestorableMongodbCollectionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableMongodbCollectionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableMongodbCollectionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID, restorableMongodbDatabaseRid) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbCollectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbCollectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbCollectionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableMongodbCollectionsClient) ListPreparer(ctx context.Context, location string, instanceID string, restorableMongodbDatabaseRid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(restorableMongodbDatabaseRid) > 0 { + queryParameters["restorableMongodbDatabaseRid"] = autorest.Encode("query", restorableMongodbDatabaseRid) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableMongodbCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableMongodbCollectionsClient) ListResponder(resp *http.Response) (result RestorableMongodbCollectionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbdatabases.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbdatabases.go new file mode 100644 index 000000000000..9d412136f034 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbdatabases.go @@ -0,0 +1,117 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableMongodbDatabasesClient is the client for the RestorableMongodbDatabases methods of the Documentdb service. +type RestorableMongodbDatabasesClient struct { + BaseClient +} + +// NewRestorableMongodbDatabasesClient creates an instance of the RestorableMongodbDatabasesClient client. +func NewRestorableMongodbDatabasesClient(subscriptionID string) RestorableMongodbDatabasesClient { + return NewRestorableMongodbDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableMongodbDatabasesClientWithBaseURI creates an instance of the RestorableMongodbDatabasesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewRestorableMongodbDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableMongodbDatabasesClient { + return RestorableMongodbDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable +// account. This helps in scenario where database was accidentally deleted to get the deletion time. This API +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +func (client RestorableMongodbDatabasesClient) List(ctx context.Context, location string, instanceID string) (result RestorableMongodbDatabasesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableMongodbDatabasesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableMongodbDatabasesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbDatabasesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbDatabasesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbDatabasesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableMongodbDatabasesClient) ListPreparer(ctx context.Context, location string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableMongodbDatabasesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableMongodbDatabasesClient) ListResponder(resp *http.Response) (result RestorableMongodbDatabasesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbresources.go new file mode 100644 index 000000000000..9f52b4d3d6ee --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablemongodbresources.go @@ -0,0 +1,125 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableMongodbResourcesClient is the client for the RestorableMongodbResources methods of the Documentdb service. +type RestorableMongodbResourcesClient struct { + BaseClient +} + +// NewRestorableMongodbResourcesClient creates an instance of the RestorableMongodbResourcesClient client. +func NewRestorableMongodbResourcesClient(subscriptionID string) RestorableMongodbResourcesClient { + return NewRestorableMongodbResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableMongodbResourcesClientWithBaseURI creates an instance of the RestorableMongodbResourcesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewRestorableMongodbResourcesClientWithBaseURI(baseURI string, subscriptionID string) RestorableMongodbResourcesClient { + return RestorableMongodbResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List return a list of database and collection combo that exist on the account at the given timestamp and location. +// This helps in scenarios to validate what resources exist at given timestamp and location. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +// restoreLocation - the location where the restorable resources are located. +// restoreTimestampInUtc - the timestamp when the restorable resources existed. +func (client RestorableMongodbResourcesClient) List(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (result RestorableMongodbResourcesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableMongodbResourcesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableMongodbResourcesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID, restoreLocation, restoreTimestampInUtc) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableMongodbResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableMongodbResourcesClient) ListPreparer(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(restoreLocation) > 0 { + queryParameters["restoreLocation"] = autorest.Encode("query", restoreLocation) + } + if len(restoreTimestampInUtc) > 0 { + queryParameters["restoreTimestampInUtc"] = autorest.Encode("query", restoreTimestampInUtc) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableMongodbResourcesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableMongodbResourcesClient) ListResponder(resp *http.Response) (result RestorableMongodbResourcesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlcontainers.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlcontainers.go new file mode 100644 index 000000000000..d805556c44b9 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlcontainers.go @@ -0,0 +1,129 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableSQLContainersClient is the client for the RestorableSQLContainers methods of the Documentdb service. +type RestorableSQLContainersClient struct { + BaseClient +} + +// NewRestorableSQLContainersClient creates an instance of the RestorableSQLContainersClient client. +func NewRestorableSQLContainersClient(subscriptionID string) RestorableSQLContainersClient { + return NewRestorableSQLContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableSQLContainersClientWithBaseURI creates an instance of the RestorableSQLContainersClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewRestorableSQLContainersClientWithBaseURI(baseURI string, subscriptionID string) RestorableSQLContainersClient { + return RestorableSQLContainersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. +// This helps in scenario where container was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +// restorableSQLDatabaseRid - the resource ID of the SQL database. +// startTime - the snapshot create timestamp after which snapshots need to be listed. +// endTime - the snapshot create timestamp before which snapshots need to be listed. +func (client RestorableSQLContainersClient) List(ctx context.Context, location string, instanceID string, restorableSQLDatabaseRid string, startTime string, endTime string) (result RestorableSQLContainersListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableSQLContainersClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableSQLContainersClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID, restorableSQLDatabaseRid, startTime, endTime) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLContainersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLContainersClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableSQLContainersClient) ListPreparer(ctx context.Context, location string, instanceID string, restorableSQLDatabaseRid string, startTime string, endTime string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(restorableSQLDatabaseRid) > 0 { + queryParameters["restorableSqlDatabaseRid"] = autorest.Encode("query", restorableSQLDatabaseRid) + } + if len(startTime) > 0 { + queryParameters["startTime"] = autorest.Encode("query", startTime) + } + if len(endTime) > 0 { + queryParameters["endTime"] = autorest.Encode("query", endTime) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableSQLContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableSQLContainersClient) ListResponder(resp *http.Response) (result RestorableSQLContainersListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqldatabases.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqldatabases.go new file mode 100644 index 000000000000..f53bbe943bf6 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqldatabases.go @@ -0,0 +1,117 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableSQLDatabasesClient is the client for the RestorableSQLDatabases methods of the Documentdb service. +type RestorableSQLDatabasesClient struct { + BaseClient +} + +// NewRestorableSQLDatabasesClient creates an instance of the RestorableSQLDatabasesClient client. +func NewRestorableSQLDatabasesClient(subscriptionID string) RestorableSQLDatabasesClient { + return NewRestorableSQLDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableSQLDatabasesClientWithBaseURI creates an instance of the RestorableSQLDatabasesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewRestorableSQLDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableSQLDatabasesClient { + return RestorableSQLDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable +// account. This helps in scenario where database was accidentally deleted to get the deletion time. This API +// requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +func (client RestorableSQLDatabasesClient) List(ctx context.Context, location string, instanceID string) (result RestorableSQLDatabasesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableSQLDatabasesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableSQLDatabasesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLDatabasesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLDatabasesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLDatabasesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableSQLDatabasesClient) ListPreparer(ctx context.Context, location string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableSQLDatabasesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableSQLDatabasesClient) ListResponder(resp *http.Response) (result RestorableSQLDatabasesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlresources.go new file mode 100644 index 000000000000..8b0e7136d1a3 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/restorablesqlresources.go @@ -0,0 +1,125 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorableSQLResourcesClient is the client for the RestorableSQLResources methods of the Documentdb service. +type RestorableSQLResourcesClient struct { + BaseClient +} + +// NewRestorableSQLResourcesClient creates an instance of the RestorableSQLResourcesClient client. +func NewRestorableSQLResourcesClient(subscriptionID string) RestorableSQLResourcesClient { + return NewRestorableSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorableSQLResourcesClientWithBaseURI creates an instance of the RestorableSQLResourcesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewRestorableSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) RestorableSQLResourcesClient { + return RestorableSQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List return a list of database and container combo that exist on the account at the given timestamp and location. +// This helps in scenarios to validate what resources exist at given timestamp and location. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. +// Parameters: +// location - cosmos DB region, with spaces between words and each word capitalized. +// instanceID - the instanceId GUID of a restorable database account. +// restoreLocation - the location where the restorable resources are located. +// restoreTimestampInUtc - the timestamp when the restorable resources existed. +func (client RestorableSQLResourcesClient) List(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (result RestorableSQLResourcesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorableSQLResourcesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.RestorableSQLResourcesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location, instanceID, restoreLocation, restoreTimestampInUtc) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.RestorableSQLResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorableSQLResourcesClient) ListPreparer(ctx context.Context, location string, instanceID string, restoreLocation string, restoreTimestampInUtc string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(restoreLocation) > 0 { + queryParameters["restoreLocation"] = autorest.Encode("query", restoreLocation) + } + if len(restoreTimestampInUtc) > 0 { + queryParameters["restoreTimestampInUtc"] = autorest.Encode("query", restoreTimestampInUtc) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorableSQLResourcesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorableSQLResourcesClient) ListResponder(resp *http.Response) (result RestorableSQLResourcesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/service.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/service.go new file mode 100644 index 000000000000..2aace541e760 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/service.go @@ -0,0 +1,416 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServiceClient is the client for the Service methods of the Documentdb service. +type ServiceClient struct { + BaseClient +} + +// NewServiceClient creates an instance of the ServiceClient client. +func NewServiceClient(subscriptionID string) ServiceClient { + return NewServiceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceClientWithBaseURI creates an instance of the ServiceClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewServiceClientWithBaseURI(baseURI string, subscriptionID string) ServiceClient { + return ServiceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// serviceName - cosmos DB service name. +// createUpdateParameters - the Service resource parameters. +func (client ServiceClient) Create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters) (result ServiceCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: createUpdateParameters, + Constraints: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties.InstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateParameters.ServiceResourceCreateUpdateProperties.InstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.ServiceClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, serviceName, createUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ServiceClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", pathParameters), + autorest.WithJSON(createUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) CreateSender(req *http.Request) (future ServiceCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ServiceClient) CreateResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes service with the given serviceName. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// serviceName - cosmos DB service name. +func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result ServiceDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.ServiceClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) DeleteSender(req *http.Request) (future ServiceDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServiceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the status of service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// serviceName - cosmos DB service name. +func (client ServiceClient) Get(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (result ServiceResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.ServiceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServiceClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServiceClient) GetResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the status of service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client ServiceClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ServiceResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.ServiceClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.ServiceClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServiceClient) ListResponder(resp *http.Response) (result ServiceResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/sqlresources.go new file mode 100644 index 000000000000..a5ca67fb87a0 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/sqlresources.go @@ -0,0 +1,3586 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SQLResourcesClient is the client for the SQLResources methods of the Documentdb service. +type SQLResourcesClient struct { + BaseClient +} + +// NewSQLResourcesClient creates an instance of the SQLResourcesClient client. +func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { + return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSQLResourcesClientWithBaseURI creates an instance of the SQLResourcesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { + return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateSQLContainer create or update an Azure Cosmos DB SQL container +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// createUpdateSQLContainerParameters - the parameters to provide for the current SQL container. +func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLContainerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLContainer") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLContainerParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, + {Target: "createUpdateSQLContainerParameters.SQLContainerCreateUpdateProperties.Resource.PartitionKey.Version", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", err.Error()) + } + + req, err := client.CreateUpdateSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, createUpdateSQLContainerParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLContainerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLContainer", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLContainerPreparer prepares the CreateUpdateSQLContainer request. +func (client SQLResourcesClient) CreateUpdateSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithJSON(createUpdateSQLContainerParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLContainerSender sends the CreateUpdateSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLContainerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLContainerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLContainerResponder handles the response to the CreateUpdateSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLDatabase create or update an Azure Cosmos DB SQL database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// createUpdateSQLDatabaseParameters - the parameters to provide for the current SQL database. +func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLDatabaseParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLDatabaseParameters.SQLDatabaseCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", err.Error()) + } + + req, err := client.CreateUpdateSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName, createUpdateSQLDatabaseParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLDatabasePreparer prepares the CreateUpdateSQLDatabase request. +func (client SQLResourcesClient) CreateUpdateSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithJSON(createUpdateSQLDatabaseParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLDatabaseSender sends the CreateUpdateSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLDatabaseSender(req *http.Request) (future SQLResourcesCreateUpdateSQLDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLDatabaseResponder handles the response to the CreateUpdateSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLRoleAssignment creates or updates an Azure Cosmos DB SQL Role Assignment. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateSQLRoleAssignmentParameters - the properties required to create or update a Role Assignment. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLRoleAssignment") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", err.Error()) + } + + req, err := client.CreateUpdateSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName, createUpdateSQLRoleAssignmentParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLRoleAssignmentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleAssignment", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLRoleAssignmentPreparer prepares the CreateUpdateSQLRoleAssignment request. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithJSON(createUpdateSQLRoleAssignmentParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLRoleAssignmentSender sends the CreateUpdateSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentSender(req *http.Request) (future SQLResourcesCreateUpdateSQLRoleAssignmentFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLRoleAssignmentResponder handles the response to the CreateUpdateSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLRoleAssignmentResponder(resp *http.Response) (result SQLRoleAssignmentGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLRoleDefinition creates or updates an Azure Cosmos DB SQL Role Definition. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// createUpdateSQLRoleDefinitionParameters - the properties required to create or update a Role Definition. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLRoleDefinition") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", err.Error()) + } + + req, err := client.CreateUpdateSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName, createUpdateSQLRoleDefinitionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLRoleDefinitionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLRoleDefinition", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLRoleDefinitionPreparer prepares the CreateUpdateSQLRoleDefinition request. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithJSON(createUpdateSQLRoleDefinitionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLRoleDefinitionSender sends the CreateUpdateSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionSender(req *http.Request) (future SQLResourcesCreateUpdateSQLRoleDefinitionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLRoleDefinitionResponder handles the response to the CreateUpdateSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLRoleDefinitionResponder(resp *http.Response) (result SQLRoleDefinitionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLStoredProcedure create or update an Azure Cosmos DB SQL storedProcedure +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +// createUpdateSQLStoredProcedureParameters - the parameters to provide for the current SQL storedProcedure. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLStoredProcedure") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLStoredProcedureParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLStoredProcedureParameters.SQLStoredProcedureCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", err.Error()) + } + + req, err := client.CreateUpdateSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSQLStoredProcedureParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLStoredProcedureSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLStoredProcedure", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLStoredProcedurePreparer prepares the CreateUpdateSQLStoredProcedure request. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithJSON(createUpdateSQLStoredProcedureParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLStoredProcedureSender sends the CreateUpdateSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureSender(req *http.Request) (future SQLResourcesCreateUpdateSQLStoredProcedureFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLStoredProcedureResponder handles the response to the CreateUpdateSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLTrigger create or update an Azure Cosmos DB SQL trigger +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +// createUpdateSQLTriggerParameters - the parameters to provide for the current SQL trigger. +func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLTrigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLTriggerParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLTriggerParameters.SQLTriggerCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", err.Error()) + } + + req, err := client.CreateUpdateSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSQLTriggerParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLTriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLTrigger", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLTriggerPreparer prepares the CreateUpdateSQLTrigger request. +func (client SQLResourcesClient) CreateUpdateSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithJSON(createUpdateSQLTriggerParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLTriggerSender sends the CreateUpdateSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLTriggerSender(req *http.Request) (future SQLResourcesCreateUpdateSQLTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLTriggerResponder handles the response to the CreateUpdateSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUpdateSQLUserDefinedFunction create or update an Azure Cosmos DB SQL userDefinedFunction +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +// createUpdateSQLUserDefinedFunctionParameters - the parameters to provide for the current SQL +// userDefinedFunction. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (result SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.CreateUpdateSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateSQLUserDefinedFunctionParameters, + Constraints: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateSQLUserDefinedFunctionParameters.SQLUserDefinedFunctionCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", err.Error()) + } + + req, err := client.CreateUpdateSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSQLUserDefinedFunctionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateSQLUserDefinedFunctionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "CreateUpdateSQLUserDefinedFunction", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateSQLUserDefinedFunctionPreparer prepares the CreateUpdateSQLUserDefinedFunction request. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithJSON(createUpdateSQLUserDefinedFunctionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateSQLUserDefinedFunctionSender sends the CreateUpdateSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateSQLUserDefinedFunctionResponder handles the response to the CreateUpdateSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteSQLContainer deletes an existing Azure Cosmos DB SQL container. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesDeleteSQLContainerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLContainer") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLContainer", err.Error()) + } + + req, err := client.DeleteSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLContainerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLContainer", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLContainerPreparer prepares the DeleteSQLContainer request. +func (client SQLResourcesClient) DeleteSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLContainerSender sends the DeleteSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLContainerSender(req *http.Request) (future SQLResourcesDeleteSQLContainerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLContainerResponder handles the response to the DeleteSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLContainerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLDatabase deletes an existing Azure Cosmos DB SQL database. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesDeleteSQLDatabaseFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLDatabase") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLDatabase", err.Error()) + } + + req, err := client.DeleteSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLDatabaseSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLDatabase", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLDatabasePreparer prepares the DeleteSQLDatabase request. +func (client SQLResourcesClient) DeleteSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLDatabaseSender sends the DeleteSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLDatabaseSender(req *http.Request) (future SQLResourcesDeleteSQLDatabaseFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLDatabaseResponder handles the response to the DeleteSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLRoleAssignment deletes an existing Azure Cosmos DB SQL Role Assignment. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) DeleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result SQLResourcesDeleteSQLRoleAssignmentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLRoleAssignment") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", err.Error()) + } + + req, err := client.DeleteSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLRoleAssignmentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleAssignment", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLRoleAssignmentPreparer prepares the DeleteSQLRoleAssignment request. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLRoleAssignmentSender sends the DeleteSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentSender(req *http.Request) (future SQLResourcesDeleteSQLRoleAssignmentFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLRoleAssignmentResponder handles the response to the DeleteSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLRoleAssignmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLRoleDefinition deletes an existing Azure Cosmos DB SQL Role Definition. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) DeleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result SQLResourcesDeleteSQLRoleDefinitionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLRoleDefinition") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", err.Error()) + } + + req, err := client.DeleteSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLRoleDefinitionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLRoleDefinition", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLRoleDefinitionPreparer prepares the DeleteSQLRoleDefinition request. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLRoleDefinitionSender sends the DeleteSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionSender(req *http.Request) (future SQLResourcesDeleteSQLRoleDefinitionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLRoleDefinitionResponder handles the response to the DeleteSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLRoleDefinitionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLStoredProcedure deletes an existing Azure Cosmos DB SQL storedProcedure. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLResourcesDeleteSQLStoredProcedureFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLStoredProcedure") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", err.Error()) + } + + req, err := client.DeleteSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLStoredProcedureSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLStoredProcedure", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLStoredProcedurePreparer prepares the DeleteSQLStoredProcedure request. +func (client SQLResourcesClient) DeleteSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLStoredProcedureSender sends the DeleteSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLStoredProcedureSender(req *http.Request) (future SQLResourcesDeleteSQLStoredProcedureFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLStoredProcedureResponder handles the response to the DeleteSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLStoredProcedureResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLTrigger deletes an existing Azure Cosmos DB SQL trigger. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLResourcesDeleteSQLTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLTrigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLTrigger", err.Error()) + } + + req, err := client.DeleteSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLTriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLTrigger", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLTriggerPreparer prepares the DeleteSQLTrigger request. +func (client SQLResourcesClient) DeleteSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLTriggerSender sends the DeleteSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLTriggerSender(req *http.Request) (future SQLResourcesDeleteSQLTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLTriggerResponder handles the response to the DeleteSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLTriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSQLUserDefinedFunction deletes an existing Azure Cosmos DB SQL userDefinedFunction. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.DeleteSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", err.Error()) + } + + req, err := client.DeleteSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSQLUserDefinedFunctionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "DeleteSQLUserDefinedFunction", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteSQLUserDefinedFunctionPreparer prepares the DeleteSQLUserDefinedFunction request. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSQLUserDefinedFunctionSender sends the DeleteSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionSender(req *http.Request) (future SQLResourcesDeleteSQLUserDefinedFunctionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteSQLUserDefinedFunctionResponder handles the response to the DeleteSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetSQLContainer gets the SQL container under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLContainerGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainer", err.Error()) + } + + req, err := client.GetSQLContainerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLContainerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure sending request") + return + } + + result, err = client.GetSQLContainerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainer", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLContainerPreparer prepares the GetSQLContainer request. +func (client SQLResourcesClient) GetSQLContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLContainerSender sends the GetSQLContainer request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLContainerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLContainerResponder handles the response to the GetSQLContainer request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLContainerResponder(resp *http.Response) (result SQLContainerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLContainerThroughput gets the RUs per second of the SQL container under an existing Azure Cosmos DB database +// account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLContainerThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLContainerThroughput", err.Error()) + } + + req, err := client.GetSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLContainerThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetSQLContainerThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLContainerThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLContainerThroughputPreparer prepares the GetSQLContainerThroughput request. +func (client SQLResourcesClient) GetSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLContainerThroughputSender sends the GetSQLContainerThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLContainerThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLContainerThroughputResponder handles the response to the GetSQLContainerThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLDatabase gets the SQL database under an existing Azure Cosmos DB database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLDatabaseGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabase", err.Error()) + } + + req, err := client.GetSQLDatabasePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure sending request") + return + } + + result, err = client.GetSQLDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabase", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLDatabasePreparer prepares the GetSQLDatabase request. +func (client SQLResourcesClient) GetSQLDatabasePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLDatabaseSender sends the GetSQLDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLDatabaseResponder handles the response to the GetSQLDatabase request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLDatabaseResponder(resp *http.Response) (result SQLDatabaseGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLDatabaseThroughput gets the RUs per second of the SQL database under an existing Azure Cosmos DB database +// account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLDatabaseThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", err.Error()) + } + + req, err := client.GetSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLDatabaseThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetSQLDatabaseThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLDatabaseThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLDatabaseThroughputPreparer prepares the GetSQLDatabaseThroughput request. +func (client SQLResourcesClient) GetSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLDatabaseThroughputSender sends the GetSQLDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLDatabaseThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLDatabaseThroughputResponder handles the response to the GetSQLDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLRoleAssignment retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. +// Parameters: +// roleAssignmentID - the GUID for the Role Assignment. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) GetSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (result SQLRoleAssignmentGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLRoleAssignment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLRoleAssignment", err.Error()) + } + + req, err := client.GetSQLRoleAssignmentPreparer(ctx, roleAssignmentID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLRoleAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", resp, "Failure sending request") + return + } + + result, err = client.GetSQLRoleAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleAssignment", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLRoleAssignmentPreparer prepares the GetSQLRoleAssignment request. +func (client SQLResourcesClient) GetSQLRoleAssignmentPreparer(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleAssignmentId": autorest.Encode("path", roleAssignmentID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLRoleAssignmentSender sends the GetSQLRoleAssignment request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLRoleAssignmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLRoleAssignmentResponder handles the response to the GetSQLRoleAssignment request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLRoleAssignmentResponder(resp *http.Response) (result SQLRoleAssignmentGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLRoleDefinition retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. +// Parameters: +// roleDefinitionID - the GUID for the Role Definition. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) GetSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (result SQLRoleDefinitionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLRoleDefinition") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLRoleDefinition", err.Error()) + } + + req, err := client.GetSQLRoleDefinitionPreparer(ctx, roleDefinitionID, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLRoleDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", resp, "Failure sending request") + return + } + + result, err = client.GetSQLRoleDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLRoleDefinition", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLRoleDefinitionPreparer prepares the GetSQLRoleDefinition request. +func (client SQLResourcesClient) GetSQLRoleDefinitionPreparer(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleDefinitionId": autorest.Encode("path", roleDefinitionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLRoleDefinitionSender sends the GetSQLRoleDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLRoleDefinitionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLRoleDefinitionResponder handles the response to the GetSQLRoleDefinition request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLRoleDefinitionResponder(resp *http.Response) (result SQLRoleDefinitionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLStoredProcedure gets the SQL storedProcedure under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// storedProcedureName - cosmos DB storedProcedure name. +func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (result SQLStoredProcedureGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLStoredProcedure") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLStoredProcedure", err.Error()) + } + + req, err := client.GetSQLStoredProcedurePreparer(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLStoredProcedureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure sending request") + return + } + + result, err = client.GetSQLStoredProcedureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLStoredProcedure", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLStoredProcedurePreparer prepares the GetSQLStoredProcedure request. +func (client SQLResourcesClient) GetSQLStoredProcedurePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storedProcedureName": autorest.Encode("path", storedProcedureName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLStoredProcedureSender sends the GetSQLStoredProcedure request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLStoredProcedureSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLStoredProcedureResponder handles the response to the GetSQLStoredProcedure request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLStoredProcedureResponder(resp *http.Response) (result SQLStoredProcedureGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLTrigger gets the SQL trigger under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// triggerName - cosmos DB trigger name. +func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (result SQLTriggerGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLTrigger") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLTrigger", err.Error()) + } + + req, err := client.GetSQLTriggerPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLTriggerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure sending request") + return + } + + result, err = client.GetSQLTriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLTrigger", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLTriggerPreparer prepares the GetSQLTrigger request. +func (client SQLResourcesClient) GetSQLTriggerPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLTriggerSender sends the GetSQLTrigger request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLTriggerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLTriggerResponder handles the response to the GetSQLTrigger request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLTriggerResponder(resp *http.Response) (result SQLTriggerGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSQLUserDefinedFunction gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// userDefinedFunctionName - cosmos DB userDefinedFunction name. +func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (result SQLUserDefinedFunctionGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.GetSQLUserDefinedFunction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", err.Error()) + } + + req, err := client.GetSQLUserDefinedFunctionPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", nil, "Failure preparing request") + return + } + + resp, err := client.GetSQLUserDefinedFunctionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure sending request") + return + } + + result, err = client.GetSQLUserDefinedFunctionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "GetSQLUserDefinedFunction", resp, "Failure responding to request") + return + } + + return +} + +// GetSQLUserDefinedFunctionPreparer prepares the GetSQLUserDefinedFunction request. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userDefinedFunctionName": autorest.Encode("path", userDefinedFunctionName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSQLUserDefinedFunctionSender sends the GetSQLUserDefinedFunction request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSQLUserDefinedFunctionResponder handles the response to the GetSQLUserDefinedFunction request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) GetSQLUserDefinedFunctionResponder(resp *http.Response) (result SQLUserDefinedFunctionGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLContainers lists the SQL container under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLContainerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLContainers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLContainers", err.Error()) + } + + req, err := client.ListSQLContainersPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLContainersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure sending request") + return + } + + result, err = client.ListSQLContainersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLContainers", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLContainersPreparer prepares the ListSQLContainers request. +func (client SQLResourcesClient) ListSQLContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLContainersSender sends the ListSQLContainers request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLContainersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLContainersResponder handles the response to the ListSQLContainers request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLContainersResponder(resp *http.Response) (result SQLContainerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLDatabases lists the SQL databases under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result SQLDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLDatabases", err.Error()) + } + + req, err := client.ListSQLDatabasesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListSQLDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLDatabasesPreparer prepares the ListSQLDatabases request. +func (client SQLResourcesClient) ListSQLDatabasesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLDatabasesSender sends the ListSQLDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLDatabasesResponder handles the response to the ListSQLDatabases request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLDatabasesResponder(resp *http.Response) (result SQLDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLRoleAssignments retrieves the list of all Azure Cosmos DB SQL Role Assignments. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLRoleAssignments(ctx context.Context, resourceGroupName string, accountName string) (result SQLRoleAssignmentListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLRoleAssignments") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLRoleAssignments", err.Error()) + } + + req, err := client.ListSQLRoleAssignmentsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLRoleAssignmentsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", resp, "Failure sending request") + return + } + + result, err = client.ListSQLRoleAssignmentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleAssignments", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLRoleAssignmentsPreparer prepares the ListSQLRoleAssignments request. +func (client SQLResourcesClient) ListSQLRoleAssignmentsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLRoleAssignmentsSender sends the ListSQLRoleAssignments request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLRoleAssignmentsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLRoleAssignmentsResponder handles the response to the ListSQLRoleAssignments request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLRoleAssignmentsResponder(resp *http.Response) (result SQLRoleAssignmentListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLRoleDefinitions retrieves the list of all Azure Cosmos DB SQL Role Definitions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client SQLResourcesClient) ListSQLRoleDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result SQLRoleDefinitionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLRoleDefinitions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", err.Error()) + } + + req, err := client.ListSQLRoleDefinitionsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLRoleDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", resp, "Failure sending request") + return + } + + result, err = client.ListSQLRoleDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLRoleDefinitions", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLRoleDefinitionsPreparer prepares the ListSQLRoleDefinitions request. +func (client SQLResourcesClient) ListSQLRoleDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLRoleDefinitionsSender sends the ListSQLRoleDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLRoleDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLRoleDefinitionsResponder handles the response to the ListSQLRoleDefinitions request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLRoleDefinitionsResponder(resp *http.Response) (result SQLRoleDefinitionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLStoredProcedures lists the SQL storedProcedure under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLStoredProcedureListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLStoredProcedures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLStoredProcedures", err.Error()) + } + + req, err := client.ListSQLStoredProceduresPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLStoredProceduresSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure sending request") + return + } + + result, err = client.ListSQLStoredProceduresResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLStoredProcedures", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLStoredProceduresPreparer prepares the ListSQLStoredProcedures request. +func (client SQLResourcesClient) ListSQLStoredProceduresPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLStoredProceduresSender sends the ListSQLStoredProcedures request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLStoredProceduresSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLStoredProceduresResponder handles the response to the ListSQLStoredProcedures request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLStoredProceduresResponder(resp *http.Response) (result SQLStoredProcedureListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLTriggers lists the SQL trigger under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLTriggerListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLTriggers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLTriggers", err.Error()) + } + + req, err := client.ListSQLTriggersPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLTriggersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure sending request") + return + } + + result, err = client.ListSQLTriggersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLTriggers", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLTriggersPreparer prepares the ListSQLTriggers request. +func (client SQLResourcesClient) ListSQLTriggersPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLTriggersSender sends the ListSQLTriggers request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLTriggersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLTriggersResponder handles the response to the ListSQLTriggers request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLTriggersResponder(resp *http.Response) (result SQLTriggerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSQLUserDefinedFunctions lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLUserDefinedFunctionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.ListSQLUserDefinedFunctions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", err.Error()) + } + + req, err := client.ListSQLUserDefinedFunctionsPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListSQLUserDefinedFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure sending request") + return + } + + result, err = client.ListSQLUserDefinedFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "ListSQLUserDefinedFunctions", resp, "Failure responding to request") + return + } + + return +} + +// ListSQLUserDefinedFunctionsPreparer prepares the ListSQLUserDefinedFunctions request. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSQLUserDefinedFunctionsSender sends the ListSQLUserDefinedFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSQLUserDefinedFunctionsResponder handles the response to the ListSQLUserDefinedFunctions request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) ListSQLUserDefinedFunctionsResponder(resp *http.Response) (result SQLUserDefinedFunctionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLContainerToAutoscale migrate an Azure Cosmos DB SQL container from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", err.Error()) + } + + req, err := client.MigrateSQLContainerToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLContainerToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLContainerToAutoscalePreparer prepares the MigrateSQLContainerToAutoscale request. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLContainerToAutoscaleSender sends the MigrateSQLContainerToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLContainerToAutoscaleResponder handles the response to the MigrateSQLContainerToAutoscale request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLContainerToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLContainerToManualThroughput migrate an Azure Cosmos DB SQL container from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (result SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLContainerToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", err.Error()) + } + + req, err := client.MigrateSQLContainerToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLContainerToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLContainerToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLContainerToManualThroughputPreparer prepares the MigrateSQLContainerToManualThroughput request. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLContainerToManualThroughputSender sends the MigrateSQLContainerToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLContainerToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLContainerToManualThroughputResponder handles the response to the MigrateSQLContainerToManualThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLContainerToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLDatabaseToAutoscale migrate an Azure Cosmos DB SQL database from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", err.Error()) + } + + req, err := client.MigrateSQLDatabaseToAutoscalePreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLDatabaseToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLDatabaseToAutoscalePreparer prepares the MigrateSQLDatabaseToAutoscale request. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLDatabaseToAutoscaleSender sends the MigrateSQLDatabaseToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLDatabaseToAutoscaleResponder handles the response to the MigrateSQLDatabaseToAutoscale request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLDatabaseToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateSQLDatabaseToManualThroughput migrate an Azure Cosmos DB SQL database from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.MigrateSQLDatabaseToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", err.Error()) + } + + req, err := client.MigrateSQLDatabaseToManualThroughputPreparer(ctx, resourceGroupName, accountName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateSQLDatabaseToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "MigrateSQLDatabaseToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateSQLDatabaseToManualThroughputPreparer prepares the MigrateSQLDatabaseToManualThroughput request. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateSQLDatabaseToManualThroughputSender sends the MigrateSQLDatabaseToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputSender(req *http.Request) (future SQLResourcesMigrateSQLDatabaseToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateSQLDatabaseToManualThroughputResponder handles the response to the MigrateSQLDatabaseToManualThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) MigrateSQLDatabaseToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RetrieveContinuousBackupInformation retrieves continuous backup information for a container resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// location - the name of the continuous backup restore location. +func (client SQLResourcesClient) RetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation) (result SQLResourcesRetrieveContinuousBackupInformationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.RetrieveContinuousBackupInformation") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "RetrieveContinuousBackupInformation", err.Error()) + } + + req, err := client.RetrieveContinuousBackupInformationPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, location) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "RetrieveContinuousBackupInformation", nil, "Failure preparing request") + return + } + + result, err = client.RetrieveContinuousBackupInformationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "RetrieveContinuousBackupInformation", result.Response(), "Failure sending request") + return + } + + return +} + +// RetrieveContinuousBackupInformationPreparer prepares the RetrieveContinuousBackupInformation request. +func (client SQLResourcesClient) RetrieveContinuousBackupInformationPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation", pathParameters), + autorest.WithJSON(location), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveContinuousBackupInformationSender sends the RetrieveContinuousBackupInformation request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) RetrieveContinuousBackupInformationSender(req *http.Request) (future SQLResourcesRetrieveContinuousBackupInformationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RetrieveContinuousBackupInformationResponder handles the response to the RetrieveContinuousBackupInformation request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) RetrieveContinuousBackupInformationResponder(resp *http.Response) (result BackupInformation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSQLContainerThroughput update RUs per second of an Azure Cosmos DB SQL container +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// containerName - cosmos DB container name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL container. +func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLContainerThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLContainerThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", err.Error()) + } + + req, err := client.UpdateSQLContainerThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSQLContainerThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLContainerThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateSQLContainerThroughputPreparer prepares the UpdateSQLContainerThroughput request. +func (client SQLResourcesClient) UpdateSQLContainerThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "containerName": autorest.Encode("path", containerName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSQLContainerThroughputSender sends the UpdateSQLContainerThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) UpdateSQLContainerThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLContainerThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateSQLContainerThroughputResponder handles the response to the UpdateSQLContainerThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) UpdateSQLContainerThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSQLDatabaseThroughput update RUs per second of an Azure Cosmos DB SQL database +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// databaseName - cosmos DB database name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL database. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLResourcesClient.UpdateSQLDatabaseThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", err.Error()) + } + + req, err := client.UpdateSQLDatabaseThroughputPreparer(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSQLDatabaseThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesClient", "UpdateSQLDatabaseThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateSQLDatabaseThroughputPreparer prepares the UpdateSQLDatabaseThroughput request. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSQLDatabaseThroughputSender sends the UpdateSQLDatabaseThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputSender(req *http.Request) (future SQLResourcesUpdateSQLDatabaseThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateSQLDatabaseThroughputResponder handles the response to the UpdateSQLDatabaseThroughput request. The method always +// closes the http.Response Body. +func (client SQLResourcesClient) UpdateSQLDatabaseThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/tableresources.go new file mode 100644 index 000000000000..524ec8ac8b55 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/tableresources.go @@ -0,0 +1,791 @@ +package documentdb + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TableResourcesClient is the client for the TableResources methods of the Documentdb service. +type TableResourcesClient struct { + BaseClient +} + +// NewTableResourcesClient creates an instance of the TableResourcesClient client. +func NewTableResourcesClient(subscriptionID string) TableResourcesClient { + return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTableResourcesClientWithBaseURI creates an instance of the TableResourcesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { + return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateUpdateTable create or update an Azure Cosmos DB Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +// createUpdateTableParameters - the parameters to provide for the current Table. +func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters) (result TableResourcesCreateUpdateTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.CreateUpdateTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: createUpdateTableParameters, + Constraints: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "createUpdateTableParameters.TableCreateUpdateProperties.Resource.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "CreateUpdateTable", err.Error()) + } + + req, err := client.CreateUpdateTablePreparer(ctx, resourceGroupName, accountName, tableName, createUpdateTableParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "CreateUpdateTable", nil, "Failure preparing request") + return + } + + result, err = client.CreateUpdateTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "CreateUpdateTable", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateUpdateTablePreparer prepares the CreateUpdateTable request. +func (client TableResourcesClient) CreateUpdateTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithJSON(createUpdateTableParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUpdateTableSender sends the CreateUpdateTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) CreateUpdateTableSender(req *http.Request) (future TableResourcesCreateUpdateTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateUpdateTableResponder handles the response to the CreateUpdateTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) CreateUpdateTableResponder(resp *http.Response) (result TableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteTable deletes an existing Azure Cosmos DB Table. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesDeleteTableFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.DeleteTable") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "DeleteTable", err.Error()) + } + + req, err := client.DeleteTablePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "DeleteTable", nil, "Failure preparing request") + return + } + + result, err = client.DeleteTableSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "DeleteTable", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteTablePreparer prepares the DeleteTable request. +func (client TableResourcesClient) DeleteTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteTableSender sends the DeleteTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) DeleteTableSender(req *http.Request) (future TableResourcesDeleteTableFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteTableResponder handles the response to the DeleteTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) DeleteTableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetTable gets the Tables under an existing Azure Cosmos DB database account with the provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.GetTable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "GetTable", err.Error()) + } + + req, err := client.GetTablePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", nil, "Failure preparing request") + return + } + + resp, err := client.GetTableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", resp, "Failure sending request") + return + } + + result, err = client.GetTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTable", resp, "Failure responding to request") + return + } + + return +} + +// GetTablePreparer prepares the GetTable request. +func (client TableResourcesClient) GetTablePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTableSender sends the GetTable request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) GetTableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTableResponder handles the response to the GetTable request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) GetTableResponder(resp *http.Response) (result TableGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTableThroughput gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the +// provided name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result ThroughputSettingsGetResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.GetTableThroughput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "GetTableThroughput", err.Error()) + } + + req, err := client.GetTableThroughputPreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", nil, "Failure preparing request") + return + } + + resp, err := client.GetTableThroughputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", resp, "Failure sending request") + return + } + + result, err = client.GetTableThroughputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "GetTableThroughput", resp, "Failure responding to request") + return + } + + return +} + +// GetTableThroughputPreparer prepares the GetTableThroughput request. +func (client TableResourcesClient) GetTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTableThroughputSender sends the GetTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) GetTableThroughputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTableThroughputResponder handles the response to the GetTableThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) GetTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListTables lists the Tables under an existing Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroupName string, accountName string) (result TableListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.ListTables") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "ListTables", err.Error()) + } + + req, err := client.ListTablesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", nil, "Failure preparing request") + return + } + + resp, err := client.ListTablesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", resp, "Failure sending request") + return + } + + result, err = client.ListTablesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "ListTables", resp, "Failure responding to request") + return + } + + return +} + +// ListTablesPreparer prepares the ListTables request. +func (client TableResourcesClient) ListTablesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTablesSender sends the ListTables request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) ListTablesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTablesResponder handles the response to the ListTables request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) ListTablesResponder(resp *http.Response) (result TableListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateTableToAutoscale migrate an Azure Cosmos DB Table from manual throughput to autoscale +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) MigrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesMigrateTableToAutoscaleFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.MigrateTableToAutoscale") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "MigrateTableToAutoscale", err.Error()) + } + + req, err := client.MigrateTableToAutoscalePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToAutoscale", nil, "Failure preparing request") + return + } + + result, err = client.MigrateTableToAutoscaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToAutoscale", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateTableToAutoscalePreparer prepares the MigrateTableToAutoscale request. +func (client TableResourcesClient) MigrateTableToAutoscalePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateTableToAutoscaleSender sends the MigrateTableToAutoscale request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) MigrateTableToAutoscaleSender(req *http.Request) (future TableResourcesMigrateTableToAutoscaleFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateTableToAutoscaleResponder handles the response to the MigrateTableToAutoscale request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) MigrateTableToAutoscaleResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateTableToManualThroughput migrate an Azure Cosmos DB Table from autoscale to manual throughput +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +func (client TableResourcesClient) MigrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesMigrateTableToManualThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.MigrateTableToManualThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "MigrateTableToManualThroughput", err.Error()) + } + + req, err := client.MigrateTableToManualThroughputPreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToManualThroughput", nil, "Failure preparing request") + return + } + + result, err = client.MigrateTableToManualThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "MigrateTableToManualThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateTableToManualThroughputPreparer prepares the MigrateTableToManualThroughput request. +func (client TableResourcesClient) MigrateTableToManualThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateTableToManualThroughputSender sends the MigrateTableToManualThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) MigrateTableToManualThroughputSender(req *http.Request) (future TableResourcesMigrateTableToManualThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateTableToManualThroughputResponder handles the response to the MigrateTableToManualThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) MigrateTableToManualThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateTableThroughput update RUs per second of an Azure Cosmos DB Table +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - cosmos DB database account name. +// tableName - cosmos DB table name. +// updateThroughputParameters - the parameters to provide for the RUs per second of the current Table. +func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (result TableResourcesUpdateTableThroughputFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableResourcesClient.UpdateTableThroughput") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-z0-9]+(-[a-z0-9]+)*`, Chain: nil}}}, + {TargetValue: updateThroughputParameters, + Constraints: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "updateThroughputParameters.ThroughputSettingsUpdateProperties.Resource.AutoscaleSettings.MaxThroughput", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("documentdb.TableResourcesClient", "UpdateTableThroughput", err.Error()) + } + + req, err := client.UpdateTableThroughputPreparer(ctx, resourceGroupName, accountName, tableName, updateThroughputParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "UpdateTableThroughput", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTableThroughputSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.TableResourcesClient", "UpdateTableThroughput", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTableThroughputPreparer prepares the UpdateTableThroughput request. +func (client TableResourcesClient) UpdateTableThroughputPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2021-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", pathParameters), + autorest.WithJSON(updateThroughputParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTableThroughputSender sends the UpdateTableThroughput request. The method will close the +// http.Response Body if it receives an error. +func (client TableResourcesClient) UpdateTableThroughputSender(req *http.Request) (future TableResourcesUpdateTableThroughputFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateTableThroughputResponder handles the response to the UpdateTableThroughput request. The method always +// closes the http.Response Body. +func (client TableResourcesClient) UpdateTableThroughputResponder(resp *http.Response) (result ThroughputSettingsGetResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/version.go b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/version.go new file mode 100644 index 000000000000..16865df813f4 --- /dev/null +++ b/services/preview/cosmos-db/mgmt/2021-07-01-preview/documentdb/version.go @@ -0,0 +1,19 @@ +package documentdb + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " documentdb/2021-07-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}