diff --git a/azurerm/internal/services/mixedreality/client/client.go b/azurerm/internal/services/mixedreality/client/client.go index 07e3e4ef4055..9ac3e0d38e39 100644 --- a/azurerm/internal/services/mixedreality/client/client.go +++ b/azurerm/internal/services/mixedreality/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality" + "github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/mixedreality/registration.go b/azurerm/internal/services/mixedreality/registration.go index 601c13c1b447..da0407d2e50c 100644 --- a/azurerm/internal/services/mixedreality/registration.go +++ b/azurerm/internal/services/mixedreality/registration.go @@ -20,7 +20,9 @@ func (r Registration) WebsiteCategories() []string { // SupportedDataSources returns the supported Data Sources supported by this Service func (r Registration) SupportedDataSources() map[string]*schema.Resource { - return map[string]*schema.Resource{} + return map[string]*schema.Resource{ + "azurerm_spatial_anchors_account": dataSourceSpatialAnchorsAccount(), + } } // SupportedResources returns the supported Resources supported by this Service diff --git a/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source.go b/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source.go new file mode 100644 index 000000000000..6b4ea8075238 --- /dev/null +++ b/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source.go @@ -0,0 +1,84 @@ +package mixedreality + +import ( + "fmt" + "regexp" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mixedreality/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func dataSourceSpatialAnchorsAccount() *schema.Resource { + return &schema.Resource{ + Read: dataSourceSpatialAnchorsAccountRead, + + Timeouts: &schema.ResourceTimeout{ + Read: schema.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringMatch( + regexp.MustCompile(`^[-\w._()]+$`), + "Spatial Anchors Account name must be 1 - 90 characters long, contain only word characters and underscores.", + ), + }, + + "location": azure.SchemaLocationForDataSource(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "account_domain": { + Type: schema.TypeString, + Computed: true, + }, + + "account_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceSpatialAnchorsAccountRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).MixedReality.SpatialAnchorsAccountClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + + id := parse.NewSpatialAnchorsAccountID(subscriptionId, resourceGroup, name) + + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return nil + } + return fmt.Errorf("retrieving Spatial Anchors Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + d.SetId(id.ID()) + + d.Set("name", resp.Name) + d.Set("resource_group_name", id.ResourceGroup) + if location := resp.Location; location != nil { + d.Set("location", azure.NormalizeLocation(*location)) + } + + if props := resp.AccountProperties; props != nil { + d.Set("account_domain", props.AccountDomain) + d.Set("account_id", props.AccountID) + } + + return nil +} diff --git a/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source_test.go b/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source_test.go new file mode 100644 index 000000000000..1d0f795b3eff --- /dev/null +++ b/azurerm/internal/services/mixedreality/spatial_anchors_account_data_source_test.go @@ -0,0 +1,53 @@ +package mixedreality_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" +) + +type SpatialAnchorsAccountDataSource struct { +} + +func TestAccSpatialAnchorsAccountDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_spatial_anchors_account", "test") + r := SpatialAnchorsAccountDataSource{} + + data.DataSourceTest(t, []resource.TestStep{ + { + Config: r.basic(data), + Check: resource.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("account_id").Exists(), + check.That(data.ResourceName).Key("account_domain").Exists(), + ), + }, + }) +} + +func (SpatialAnchorsAccountDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-mr-%d" + location = "%s" +} + +resource "azurerm_spatial_anchors_account" "test" { + name = "accTEst_saa%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +data "azurerm_spatial_anchors_account" "test" { + name = azurerm_spatial_anchors_account.test.name + resource_group_name = azurerm_resource_group.test.name +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} diff --git a/azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go b/azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go index 5c5e4501c684..e31c606c6e2e 100644 --- a/azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go +++ b/azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality" + "github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -50,6 +50,16 @@ func resourceSpatialAnchorsAccount() *schema.Resource { "resource_group_name": azure.SchemaResourceGroupName(), + "account_domain": { + Type: schema.TypeString, + Computed: true, + }, + + "account_id": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tags.ForceNewSchema(), }, } @@ -127,6 +137,11 @@ func resourceSpatialAnchorsAccountRead(d *schema.ResourceData, meta interface{}) d.Set("location", azure.NormalizeLocation(*location)) } + if props := resp.AccountProperties; props != nil { + d.Set("account_domain", props.AccountDomain) + d.Set("account_id", props.AccountID) + } + return tags.FlattenAndSet(d, resp.Tags) } diff --git a/azurerm/internal/services/mixedreality/spatial_anchors_account_resource_test.go b/azurerm/internal/services/mixedreality/spatial_anchors_account_resource_test.go index 2405c6be6942..74a4ee9e11d9 100644 --- a/azurerm/internal/services/mixedreality/spatial_anchors_account_resource_test.go +++ b/azurerm/internal/services/mixedreality/spatial_anchors_account_resource_test.go @@ -26,6 +26,8 @@ func TestAccSpatialAnchorsAccount_basic(t *testing.T) { Config: r.basic(data), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("account_id").Exists(), + check.That(data.ResourceName).Key("account_domain").Exists(), ), }, data.ImportStep(), @@ -60,7 +62,7 @@ func (SpatialAnchorsAccountResource) Exists(ctx context.Context, clients *client return nil, fmt.Errorf("retrieving Spatial Anchors Account %s (resource group: %s): %v", id.Name, id.ResourceGroup, err) } - return utils.Bool(resp.SpatialAnchorsAccountProperties != nil), nil + return utils.Bool(resp.AccountProperties != nil), nil } func (SpatialAnchorsAccountResource) basic(data acceptance.TestData) string { @@ -79,7 +81,7 @@ resource "azurerm_spatial_anchors_account" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name } -`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } func (SpatialAnchorsAccountResource) complete(data acceptance.TestData) string { @@ -102,5 +104,5 @@ resource "azurerm_spatial_anchors_account" "test" { Environment = "Production" } } -`, data.RandomInteger, data.Locations.Secondary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/_meta.json similarity index 56% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/_meta.json index cfae9d1a27e9..4eb50cea0660 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "0b17e6a5e811fd7b122d383b4942441d95e5e8cf", "readme": "/_/azure-rest-api-specs/specification/mixedreality/resource-manager/readme.md", - "tag": "package-2019-02-preview", + "tag": "package-2021-01", "use": "@microsoft.azure/autorest.go@2.1.180", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2019-02-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/mixedreality/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2021-01 --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/mixedreality/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/client.go index 088ce5c94449..0add6ec7d2ef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/client.go @@ -1,4 +1,4 @@ -// Package mixedreality implements the Azure ARM Mixedreality service API version 2019-02-28-preview. +// Package mixedreality implements the Azure ARM Mixedreality service API version 2021-01-01. // // Mixed Reality Client package mixedreality @@ -45,7 +45,7 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { } } -// CheckNameAvailabilityLocal check Name Availability for global uniqueness +// CheckNameAvailabilityLocal check Name Availability for local uniqueness // Parameters: // location - the location in which uniqueness will be verified. // checkNameAvailability - check Name Availability Request. @@ -100,7 +100,7 @@ func (client BaseClient) CheckNameAvailabilityLocalPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/enums.go similarity index 75% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/enums.go index 6f997e55ead6..78c8ae2e2160 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/enums.go @@ -6,6 +6,25 @@ package mixedreality // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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} +} + // NameUnavailableReason enumerates the values for name unavailable reason. type NameUnavailableReason string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/models.go similarity index 51% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/models.go index 30c342eb10cb..2753f971d47b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/models.go @@ -10,13 +10,48 @@ import ( "context" "encoding/json" "github.com/Azure/go-autorest/autorest" + "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/mixedreality/mgmt/2019-02-28/mixedreality" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality" + +// AccountKeyRegenerateRequest request for account key regeneration +type AccountKeyRegenerateRequest struct { + // Serial - serial of key to be regenerated + Serial *int32 `json:"serial,omitempty"` +} + +// AccountKeys developer Keys of account +type AccountKeys struct { + autorest.Response `json:"-"` + // PrimaryKey - READ-ONLY; value of primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - READ-ONLY; value of secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` +} + +// AccountProperties common Properties shared by Mixed Reality Accounts +type AccountProperties struct { + // StorageAccountName - The name of the storage account associated with this accountId + StorageAccountName *string `json:"storageAccountName,omitempty"` + // AccountID - READ-ONLY; unique id of certain account. + AccountID *string `json:"accountId,omitempty"` + // AccountDomain - READ-ONLY; Correspond domain name of certain Spatial Anchors Account + AccountDomain *string `json:"accountDomain,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountProperties. +func (ap AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.StorageAccountName != nil { + objectMap["storageAccountName"] = ap.StorageAccountName + } + return json.Marshal(objectMap) +} // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { @@ -49,16 +84,22 @@ type CheckNameAvailabilityResponse struct { Message *string `json:"message,omitempty"` } -// ErrorResponse response on Error -type ErrorResponse struct { - // Message - Describes the error in detail and provides debugging information - Message *string `json:"message,omitempty"` - // Code - String that can be used to programmatically identify the error. +// CloudError an Error response. +type CloudError struct { + // Error - An Error response. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from Azure. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. Code *string `json:"code,omitempty"` - // Target - The target of the particular error + // Message - A message describing the error, intended to be suitable for displaying in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. Target *string `json:"target,omitempty"` - // Details - An array of JSON objects that MUST contain name/value pairs for code and message, and MAY contain a name/value pair for target, as described above.The contents of this section are service-defined but must adhere to the aforementioned schema. - Details *string `json:"details,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` } // Identity identity for the resource. @@ -80,6 +121,44 @@ func (i Identity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// LogSpecification specifications of the Log for Azure Monitoring +type LogSpecification struct { + // Name - Name of the log + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the log + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Blob duration of the log + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// MetricDimension specifications of the Dimension of metrics +type MetricDimension struct { + // Name - Name of the dimension + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the dimension + DisplayName *string `json:"displayName,omitempty"` + // InternalName - Internal name of the dimension. + InternalName *string `json:"internalName,omitempty"` +} + +// MetricSpecification specifications of the Metrics for Azure Monitoring +type MetricSpecification struct { + // Name - Name of the metric + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the metric + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Localized friendly description of the metric + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit that makes sense for the metric + Unit *string `json:"unit,omitempty"` + // AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + AggregationType *string `json:"aggregationType,omitempty"` + // InternalMetricName - Internal metric name. + InternalMetricName *string `json:"internalMetricName,omitempty"` + // Dimensions - Dimensions of the metric + Dimensions *[]MetricDimension `json:"dimensions,omitempty"` +} + // Operation REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -88,6 +167,10 @@ type Operation struct { Display *OperationDisplay `json:"display,omitempty"` // IsDataAction - Whether or not this is a data plane operation IsDataAction *bool `json:"isDataAction,omitempty"` + // Origin - The origin + Origin *string `json:"origin,omitempty"` + // Properties - Properties of the operation + Properties *OperationProperties `json:"properties,omitempty"` } // OperationDisplay the object that represents the operation. @@ -102,9 +185,9 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationList result of the request to list Resource Provider operations. It contains a list of +// OperationPage 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 OperationList struct { +type OperationPage struct { autorest.Response `json:"-"` // Value - List of operations supported by the Resource Provider. Value *[]Operation `json:"value,omitempty"` @@ -112,17 +195,17 @@ type OperationList struct { NextLink *string `json:"nextLink,omitempty"` } -// OperationListIterator provides access to a complete listing of Operation values. -type OperationListIterator struct { +// OperationPageIterator provides access to a complete listing of Operation values. +type OperationPageIterator struct { i int - page OperationListPage + page OperationPagePage } // 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 *OperationListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *OperationPageIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/OperationPageIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -147,67 +230,67 @@ func (iter *OperationListIterator) NextWithContext(ctx context.Context) (err err // 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 *OperationListIterator) Next() error { +func (iter *OperationPageIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListIterator) NotDone() bool { +func (iter OperationPageIterator) 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 OperationListIterator) Response() OperationList { +func (iter OperationPageIterator) Response() OperationPage { 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 OperationListIterator) Value() Operation { +func (iter OperationPageIterator) Value() Operation { if !iter.page.NotDone() { return Operation{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the OperationListIterator type. -func NewOperationListIterator(page OperationListPage) OperationListIterator { - return OperationListIterator{page: page} +// Creates a new instance of the OperationPageIterator type. +func NewOperationPageIterator(page OperationPagePage) OperationPageIterator { + return OperationPageIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ol OperationList) IsEmpty() bool { - return ol.Value == nil || len(*ol.Value) == 0 +func (op OperationPage) IsEmpty() bool { + return op.Value == nil || len(*op.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (ol OperationList) hasNextLink() bool { - return ol.NextLink != nil && len(*ol.NextLink) != 0 +func (op OperationPage) hasNextLink() bool { + return op.NextLink != nil && len(*op.NextLink) != 0 } -// operationListPreparer prepares a request to retrieve the next set of results. +// operationPagePreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) { - if !ol.hasNextLink() { +func (op OperationPage) operationPagePreparer(ctx context.Context) (*http.Request, error) { + if !op.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ol.NextLink))) + autorest.WithBaseURL(to.String(op.NextLink))) } -// OperationListPage contains a page of Operation values. -type OperationListPage struct { - fn func(context.Context, OperationList) (OperationList, error) - ol OperationList +// OperationPagePage contains a page of Operation values. +type OperationPagePage struct { + fn func(context.Context, OperationPage) (OperationPage, error) + op OperationPage } // 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 *OperationListPage) NextWithContext(ctx context.Context) (err error) { +func (page *OperationPagePage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/OperationPagePage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -217,11 +300,11 @@ func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) }() } for { - next, err := page.fn(ctx, page.ol) + next, err := page.fn(ctx, page.op) if err != nil { return err } - page.ol = next + page.op = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -232,36 +315,42 @@ func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) // 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 *OperationListPage) Next() error { +func (page *OperationPagePage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListPage) NotDone() bool { - return !page.ol.IsEmpty() +func (page OperationPagePage) NotDone() bool { + return !page.op.IsEmpty() } // Response returns the raw server response from the last page request. -func (page OperationListPage) Response() OperationList { - return page.ol +func (page OperationPagePage) Response() OperationPage { + return page.op } // Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListPage) Values() []Operation { - if page.ol.IsEmpty() { +func (page OperationPagePage) Values() []Operation { + if page.op.IsEmpty() { return nil } - return *page.ol.Value + return *page.op.Value } -// Creates a new instance of the OperationListPage type. -func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { - return OperationListPage{ +// Creates a new instance of the OperationPagePage type. +func NewOperationPagePage(cur OperationPage, getNextPage func(context.Context, OperationPage) (OperationPage, error)) OperationPagePage { + return OperationPagePage{ fn: getNextPage, - ol: cur, + op: cur, } } +// OperationProperties operation properties. +type OperationProperties struct { + // ServiceSpecification - Service specification. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + // Plan plan for the resource. type Plan struct { // Name - A user defined name of the 3rd Party Artifact that is being procured. @@ -287,6 +376,338 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// RemoteRenderingAccount remoteRenderingAccount Response. +type RemoteRenderingAccount struct { + autorest.Response `json:"-"` + // AccountProperties - Property bag. + *AccountProperties `json:"properties,omitempty"` + // Identity - The identity associated with this account + Identity *Identity `json:"identity,omitempty"` + // Plan - The plan associated with this account + Plan *Identity `json:"plan,omitempty"` + // Sku - The sku associated with this account + Sku *Sku `json:"sku,omitempty"` + // Kind - The kind of account, if supported + Kind *Sku `json:"kind,omitempty"` + // SystemData - System metadata for this account + SystemData *SystemData `json:"systemData,omitempty"` + // 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 RemoteRenderingAccount. +func (rra RemoteRenderingAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rra.AccountProperties != nil { + objectMap["properties"] = rra.AccountProperties + } + if rra.Identity != nil { + objectMap["identity"] = rra.Identity + } + if rra.Plan != nil { + objectMap["plan"] = rra.Plan + } + if rra.Sku != nil { + objectMap["sku"] = rra.Sku + } + if rra.Kind != nil { + objectMap["kind"] = rra.Kind + } + if rra.SystemData != nil { + objectMap["systemData"] = rra.SystemData + } + if rra.Tags != nil { + objectMap["tags"] = rra.Tags + } + if rra.Location != nil { + objectMap["location"] = rra.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RemoteRenderingAccount struct. +func (rra *RemoteRenderingAccount) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + rra.AccountProperties = &accountProperties + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + rra.Identity = &identity + } + case "plan": + if v != nil { + var plan Identity + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + rra.Plan = &plan + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + rra.Sku = &sku + } + case "kind": + if v != nil { + var kind Sku + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rra.Kind = &kind + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + rra.SystemData = &systemData + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rra.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rra.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rra.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rra.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rra.Type = &typeVar + } + } + } + + return nil +} + +// RemoteRenderingAccountPage result of the request to get resource collection. It contains a list of +// resources and a URL link to get the next set of results. +type RemoteRenderingAccountPage struct { + autorest.Response `json:"-"` + // Value - List of resources supported by the Resource Provider. + Value *[]RemoteRenderingAccount `json:"value,omitempty"` + // NextLink - URL to get the next set of resource list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RemoteRenderingAccountPageIterator provides access to a complete listing of RemoteRenderingAccount +// values. +type RemoteRenderingAccountPageIterator struct { + i int + page RemoteRenderingAccountPagePage +} + +// 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 *RemoteRenderingAccountPageIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountPageIterator.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 *RemoteRenderingAccountPageIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RemoteRenderingAccountPageIterator) 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 RemoteRenderingAccountPageIterator) Response() RemoteRenderingAccountPage { + 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 RemoteRenderingAccountPageIterator) Value() RemoteRenderingAccount { + if !iter.page.NotDone() { + return RemoteRenderingAccount{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RemoteRenderingAccountPageIterator type. +func NewRemoteRenderingAccountPageIterator(page RemoteRenderingAccountPagePage) RemoteRenderingAccountPageIterator { + return RemoteRenderingAccountPageIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rrap RemoteRenderingAccountPage) IsEmpty() bool { + return rrap.Value == nil || len(*rrap.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rrap RemoteRenderingAccountPage) hasNextLink() bool { + return rrap.NextLink != nil && len(*rrap.NextLink) != 0 +} + +// remoteRenderingAccountPagePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rrap RemoteRenderingAccountPage) remoteRenderingAccountPagePreparer(ctx context.Context) (*http.Request, error) { + if !rrap.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rrap.NextLink))) +} + +// RemoteRenderingAccountPagePage contains a page of RemoteRenderingAccount values. +type RemoteRenderingAccountPagePage struct { + fn func(context.Context, RemoteRenderingAccountPage) (RemoteRenderingAccountPage, error) + rrap RemoteRenderingAccountPage +} + +// 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 *RemoteRenderingAccountPagePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountPagePage.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.rrap) + if err != nil { + return err + } + page.rrap = 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 *RemoteRenderingAccountPagePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RemoteRenderingAccountPagePage) NotDone() bool { + return !page.rrap.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RemoteRenderingAccountPagePage) Response() RemoteRenderingAccountPage { + return page.rrap +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RemoteRenderingAccountPagePage) Values() []RemoteRenderingAccount { + if page.rrap.IsEmpty() { + return nil + } + return *page.rrap.Value +} + +// Creates a new instance of the RemoteRenderingAccountPagePage type. +func NewRemoteRenderingAccountPagePage(cur RemoteRenderingAccountPage, getNextPage func(context.Context, RemoteRenderingAccountPage) (RemoteRenderingAccountPage, error)) RemoteRenderingAccountPagePage { + return RemoteRenderingAccountPagePage{ + fn: getNextPage, + rrap: cur, + } +} + // 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} @@ -309,7 +730,7 @@ type ResourceModelWithAllowedPropertySet struct { Type *string `json:"type,omitempty"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string `json:"managedBy,omitempty"` // Kind - Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. Kind *string `json:"kind,omitempty"` @@ -396,6 +817,14 @@ type ResourceModelWithAllowedPropertySetSku struct { Capacity *int32 `json:"capacity,omitempty"` } +// ServiceSpecification service specification payload +type ServiceSpecification struct { + // LogSpecifications - Specifications of the Log for Azure Monitoring + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` + // MetricSpecifications - Specifications of the Metrics for Azure Monitoring + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` +} + // Sku the resource model definition representing SKU type Sku struct { // Name - The name of the SKU. Ex - P3. It is typically a letter+number code @@ -413,10 +842,18 @@ type Sku struct { // SpatialAnchorsAccount spatialAnchorsAccount Response. type SpatialAnchorsAccount struct { autorest.Response `json:"-"` - // SpatialAnchorsAccountProperties - Property bag. - *SpatialAnchorsAccountProperties `json:"properties,omitempty"` + // AccountProperties - Property bag. + *AccountProperties `json:"properties,omitempty"` // Identity - The identity associated with this account Identity *Identity `json:"identity,omitempty"` + // Plan - The plan associated with this account + Plan *Identity `json:"plan,omitempty"` + // Sku - The sku associated with this account + Sku *Sku `json:"sku,omitempty"` + // Kind - The kind of account, if supported + Kind *Sku `json:"kind,omitempty"` + // SystemData - System metadata for this account + SystemData *SystemData `json:"systemData,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives @@ -432,12 +869,24 @@ type SpatialAnchorsAccount struct { // MarshalJSON is the custom marshaler for SpatialAnchorsAccount. func (saa SpatialAnchorsAccount) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if saa.SpatialAnchorsAccountProperties != nil { - objectMap["properties"] = saa.SpatialAnchorsAccountProperties + if saa.AccountProperties != nil { + objectMap["properties"] = saa.AccountProperties } if saa.Identity != nil { objectMap["identity"] = saa.Identity } + if saa.Plan != nil { + objectMap["plan"] = saa.Plan + } + if saa.Sku != nil { + objectMap["sku"] = saa.Sku + } + if saa.Kind != nil { + objectMap["kind"] = saa.Kind + } + if saa.SystemData != nil { + objectMap["systemData"] = saa.SystemData + } if saa.Tags != nil { objectMap["tags"] = saa.Tags } @@ -458,12 +907,12 @@ func (saa *SpatialAnchorsAccount) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var spatialAnchorsAccountProperties SpatialAnchorsAccountProperties - err = json.Unmarshal(*v, &spatialAnchorsAccountProperties) + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) if err != nil { return err } - saa.SpatialAnchorsAccountProperties = &spatialAnchorsAccountProperties + saa.AccountProperties = &accountProperties } case "identity": if v != nil { @@ -474,6 +923,42 @@ func (saa *SpatialAnchorsAccount) UnmarshalJSON(body []byte) error { } saa.Identity = &identity } + case "plan": + if v != nil { + var plan Identity + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + saa.Plan = &plan + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + saa.Sku = &sku + } + case "kind": + if v != nil { + var kind Sku + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + saa.Kind = &kind + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + saa.SystemData = &systemData + } case "tags": if v != nil { var tags map[string]*string @@ -525,24 +1010,9 @@ func (saa *SpatialAnchorsAccount) UnmarshalJSON(body []byte) error { return nil } -// SpatialAnchorsAccountKeyRegenerateRequest spatial Anchors Account Regenerate Key -type SpatialAnchorsAccountKeyRegenerateRequest struct { - // Serial - serial of key to be regenerated - Serial *int32 `json:"serial,omitempty"` -} - -// SpatialAnchorsAccountKeys spatial Anchors Account Keys -type SpatialAnchorsAccountKeys struct { - autorest.Response `json:"-"` - // PrimaryKey - READ-ONLY; value of primary key. - PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - READ-ONLY; value of secondary key. - SecondaryKey *string `json:"secondaryKey,omitempty"` -} - -// SpatialAnchorsAccountList result of the request to get resource collection. It contains a list of +// SpatialAnchorsAccountPage result of the request to get resource collection. It contains a list of // resources and a URL link to get the next set of results. -type SpatialAnchorsAccountList struct { +type SpatialAnchorsAccountPage struct { autorest.Response `json:"-"` // Value - List of resources supported by the Resource Provider. Value *[]SpatialAnchorsAccount `json:"value,omitempty"` @@ -550,17 +1020,17 @@ type SpatialAnchorsAccountList struct { NextLink *string `json:"nextLink,omitempty"` } -// SpatialAnchorsAccountListIterator provides access to a complete listing of SpatialAnchorsAccount values. -type SpatialAnchorsAccountListIterator struct { +// SpatialAnchorsAccountPageIterator provides access to a complete listing of SpatialAnchorsAccount values. +type SpatialAnchorsAccountPageIterator struct { i int - page SpatialAnchorsAccountListPage + page SpatialAnchorsAccountPagePage } // 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 *SpatialAnchorsAccountListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SpatialAnchorsAccountPageIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountPageIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -585,67 +1055,67 @@ func (iter *SpatialAnchorsAccountListIterator) NextWithContext(ctx context.Conte // 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 *SpatialAnchorsAccountListIterator) Next() error { +func (iter *SpatialAnchorsAccountPageIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SpatialAnchorsAccountListIterator) NotDone() bool { +func (iter SpatialAnchorsAccountPageIterator) 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 SpatialAnchorsAccountListIterator) Response() SpatialAnchorsAccountList { +func (iter SpatialAnchorsAccountPageIterator) Response() SpatialAnchorsAccountPage { 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 SpatialAnchorsAccountListIterator) Value() SpatialAnchorsAccount { +func (iter SpatialAnchorsAccountPageIterator) Value() SpatialAnchorsAccount { if !iter.page.NotDone() { return SpatialAnchorsAccount{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the SpatialAnchorsAccountListIterator type. -func NewSpatialAnchorsAccountListIterator(page SpatialAnchorsAccountListPage) SpatialAnchorsAccountListIterator { - return SpatialAnchorsAccountListIterator{page: page} +// Creates a new instance of the SpatialAnchorsAccountPageIterator type. +func NewSpatialAnchorsAccountPageIterator(page SpatialAnchorsAccountPagePage) SpatialAnchorsAccountPageIterator { + return SpatialAnchorsAccountPageIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (saal SpatialAnchorsAccountList) IsEmpty() bool { - return saal.Value == nil || len(*saal.Value) == 0 +func (saap SpatialAnchorsAccountPage) IsEmpty() bool { + return saap.Value == nil || len(*saap.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (saal SpatialAnchorsAccountList) hasNextLink() bool { - return saal.NextLink != nil && len(*saal.NextLink) != 0 +func (saap SpatialAnchorsAccountPage) hasNextLink() bool { + return saap.NextLink != nil && len(*saap.NextLink) != 0 } -// spatialAnchorsAccountListPreparer prepares a request to retrieve the next set of results. +// spatialAnchorsAccountPagePreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (saal SpatialAnchorsAccountList) spatialAnchorsAccountListPreparer(ctx context.Context) (*http.Request, error) { - if !saal.hasNextLink() { +func (saap SpatialAnchorsAccountPage) spatialAnchorsAccountPagePreparer(ctx context.Context) (*http.Request, error) { + if !saap.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(saal.NextLink))) + autorest.WithBaseURL(to.String(saap.NextLink))) } -// SpatialAnchorsAccountListPage contains a page of SpatialAnchorsAccount values. -type SpatialAnchorsAccountListPage struct { - fn func(context.Context, SpatialAnchorsAccountList) (SpatialAnchorsAccountList, error) - saal SpatialAnchorsAccountList +// SpatialAnchorsAccountPagePage contains a page of SpatialAnchorsAccount values. +type SpatialAnchorsAccountPagePage struct { + fn func(context.Context, SpatialAnchorsAccountPage) (SpatialAnchorsAccountPage, error) + saap SpatialAnchorsAccountPage } // 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 *SpatialAnchorsAccountListPage) NextWithContext(ctx context.Context) (err error) { +func (page *SpatialAnchorsAccountPagePage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountPagePage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -655,11 +1125,11 @@ func (page *SpatialAnchorsAccountListPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.saal) + next, err := page.fn(ctx, page.saap) if err != nil { return err } - page.saal = next + page.saap = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -670,42 +1140,50 @@ func (page *SpatialAnchorsAccountListPage) NextWithContext(ctx context.Context) // 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 *SpatialAnchorsAccountListPage) Next() error { +func (page *SpatialAnchorsAccountPagePage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SpatialAnchorsAccountListPage) NotDone() bool { - return !page.saal.IsEmpty() +func (page SpatialAnchorsAccountPagePage) NotDone() bool { + return !page.saap.IsEmpty() } // Response returns the raw server response from the last page request. -func (page SpatialAnchorsAccountListPage) Response() SpatialAnchorsAccountList { - return page.saal +func (page SpatialAnchorsAccountPagePage) Response() SpatialAnchorsAccountPage { + return page.saap } // Values returns the slice of values for the current page or nil if there are no values. -func (page SpatialAnchorsAccountListPage) Values() []SpatialAnchorsAccount { - if page.saal.IsEmpty() { +func (page SpatialAnchorsAccountPagePage) Values() []SpatialAnchorsAccount { + if page.saap.IsEmpty() { return nil } - return *page.saal.Value + return *page.saap.Value } -// Creates a new instance of the SpatialAnchorsAccountListPage type. -func NewSpatialAnchorsAccountListPage(cur SpatialAnchorsAccountList, getNextPage func(context.Context, SpatialAnchorsAccountList) (SpatialAnchorsAccountList, error)) SpatialAnchorsAccountListPage { - return SpatialAnchorsAccountListPage{ +// Creates a new instance of the SpatialAnchorsAccountPagePage type. +func NewSpatialAnchorsAccountPagePage(cur SpatialAnchorsAccountPage, getNextPage func(context.Context, SpatialAnchorsAccountPage) (SpatialAnchorsAccountPage, error)) SpatialAnchorsAccountPagePage { + return SpatialAnchorsAccountPagePage{ fn: getNextPage, - saal: cur, + saap: cur, } } -// SpatialAnchorsAccountProperties spatial Anchors Account Customize Properties -type SpatialAnchorsAccountProperties struct { - // AccountID - READ-ONLY; unique id of certain Spatial Anchors Account data contract. - AccountID *string `json:"accountId,omitempty"` - // AccountDomain - READ-ONLY; Correspond domain name of certain Spatial Anchors Account - AccountDomain *string `json:"accountDomain,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 type of identity that last modified the resource. + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/operations.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/operations.go index 98012ba59f86..6ccc2a97150a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/operations.go @@ -31,13 +31,13 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List exposing Available Operations -func (client OperationsClient) List(ctx context.Context) (result OperationListPage, err error) { +func (client OperationsClient) List(ctx context.Context) (result OperationPagePage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 - if result.ol.Response.Response != nil { - sc = result.ol.Response.Response.StatusCode + if result.op.Response.Response != nil { + sc = result.op.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -51,17 +51,17 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListPa resp, err := client.ListSender(req) if err != nil { - result.ol.Response = autorest.Response{Response: resp} + result.op.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "List", resp, "Failure sending request") return } - result.ol, err = client.ListResponder(resp) + result.op, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "List", resp, "Failure responding to request") return } - if result.ol.hasNextLink() && result.ol.IsEmpty() { + if result.op.hasNextLink() && result.op.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListPa // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,7 +92,7 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationList, err error) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationPage, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -103,8 +103,8 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat } // listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationList) (result OperationList, err error) { - req, err := lastResults.operationListPreparer(ctx) +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationPage) (result OperationPage, err error) { + req, err := lastResults.operationPagePreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -124,7 +124,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationPageIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/remoterenderingaccounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/remoterenderingaccounts.go new file mode 100644 index 000000000000..4166384209cd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/remoterenderingaccounts.go @@ -0,0 +1,811 @@ +package mixedreality + +// 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" +) + +// RemoteRenderingAccountsClient is the mixed Reality Client +type RemoteRenderingAccountsClient struct { + BaseClient +} + +// NewRemoteRenderingAccountsClient creates an instance of the RemoteRenderingAccountsClient client. +func NewRemoteRenderingAccountsClient(subscriptionID string) RemoteRenderingAccountsClient { + return NewRemoteRenderingAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRemoteRenderingAccountsClientWithBaseURI creates an instance of the RemoteRenderingAccountsClient 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 NewRemoteRenderingAccountsClientWithBaseURI(baseURI string, subscriptionID string) RemoteRenderingAccountsClient { + return RemoteRenderingAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creating or Updating a Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// remoteRenderingAccount - remote Rendering Account parameter. +func (client RemoteRenderingAccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.Create") + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: remoteRenderingAccount, + Constraints: []validation.Constraint{{Target: "remoteRenderingAccount.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "remoteRenderingAccount.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "remoteRenderingAccount.Kind", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "remoteRenderingAccount.Kind.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, remoteRenderingAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RemoteRenderingAccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (*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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", pathParameters), + autorest.WithJSON(remoteRenderingAccount), + 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 RemoteRenderingAccountsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) CreateResponder(resp *http.Response) (result RemoteRenderingAccount, 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 Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RemoteRenderingAccountsClient) 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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{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 RemoteRenderingAccountsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RemoteRenderingAccountsClient) 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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) GetResponder(resp *http.Response) (result RemoteRenderingAccount, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list Resources by Resource Group +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client RemoteRenderingAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RemoteRenderingAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.rrap.Response.Response != nil { + sc = result.rrap.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rrap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rrap, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.rrap.hasNextLink() && result.rrap.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client RemoteRenderingAccountsClient) 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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result RemoteRenderingAccountPage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client RemoteRenderingAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults RemoteRenderingAccountPage) (result RemoteRenderingAccountPage, err error) { + req, err := lastResults.remoteRenderingAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemoteRenderingAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RemoteRenderingAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list Remote Rendering Accounts by Subscription +func (client RemoteRenderingAccountsClient) ListBySubscription(ctx context.Context) (result RemoteRenderingAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.rrap.Response.Response != nil { + sc = result.rrap.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.rrap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.rrap, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.rrap.hasNextLink() && result.rrap.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client RemoteRenderingAccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result RemoteRenderingAccountPage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client RemoteRenderingAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults RemoteRenderingAccountPage) (result RemoteRenderingAccountPage, err error) { + req, err := lastResults.remoteRenderingAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemoteRenderingAccountsClient) ListBySubscriptionComplete(ctx context.Context) (result RemoteRenderingAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListBySubscription") + 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.ListBySubscription(ctx) + return +} + +// ListKeys list Both of the 2 Keys of a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client RemoteRenderingAccountsClient) 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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKeys regenerate specified Key of a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// regenerate - required information for key regeneration. +func (client RemoteRenderingAccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.RegenerateKeys") + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", err.Error()) + } + + req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, regenerate) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", resp, "Failure responding to request") + return + } + + return +} + +// RegenerateKeysPreparer prepares the RegenerateKeys request. +func (client RemoteRenderingAccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (*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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys", pathParameters), + autorest.WithJSON(regenerate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeysSender sends the RegenerateKeys request. The method will close the +// http.Response Body if it receives an error. +func (client RemoteRenderingAccountsClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updating a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// remoteRenderingAccount - remote Rendering Account parameter. +func (client RemoteRenderingAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.Update") + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, remoteRenderingAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RemoteRenderingAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (*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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", pathParameters), + autorest.WithJSON(remoteRenderingAccount), + 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 RemoteRenderingAccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) UpdateResponder(resp *http.Response) (result RemoteRenderingAccount, 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/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/spatialanchorsaccounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/spatialanchorsaccounts.go similarity index 74% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/spatialanchorsaccounts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/spatialanchorsaccounts.go index 0afb164871f7..92c2ce01a57b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/spatialanchorsaccounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/spatialanchorsaccounts.go @@ -35,9 +35,9 @@ func NewSpatialAnchorsAccountsClientWithBaseURI(baseURI string, subscriptionID s // Create creating or Updating a Spatial Anchors Account. // Parameters: // resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. +// accountName - name of an Mixed Reality Account. // spatialAnchorsAccount - spatial Anchors Account parameter. -func (client SpatialAnchorsAccountsClient) Create(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { +func (client SpatialAnchorsAccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.Create") defer func() { @@ -53,14 +53,19 @@ func (client SpatialAnchorsAccountsClient) Create(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: spatialAnchorsAccount, + Constraints: []validation.Constraint{{Target: "spatialAnchorsAccount.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "spatialAnchorsAccount.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "spatialAnchorsAccount.Kind", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "spatialAnchorsAccount.Kind.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount) + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, spatialAnchorsAccount) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Create", nil, "Failure preparing request") return @@ -83,14 +88,14 @@ func (client SpatialAnchorsAccountsClient) Create(ctx context.Context, resourceG } // CreatePreparer prepares the Create request. -func (client SpatialAnchorsAccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { +func (client SpatialAnchorsAccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -99,7 +104,7 @@ func (client SpatialAnchorsAccountsClient) CreatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), autorest.WithJSON(spatialAnchorsAccount), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -126,8 +131,8 @@ func (client SpatialAnchorsAccountsClient) CreateResponder(resp *http.Response) // Delete delete a Spatial Anchors Account. // Parameters: // resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. -func (client SpatialAnchorsAccountsClient) Delete(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (result autorest.Response, err error) { +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.Delete") defer func() { @@ -143,14 +148,14 @@ func (client SpatialAnchorsAccountsClient) Delete(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, spatialAnchorsAccountName) + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Delete", nil, "Failure preparing request") return @@ -173,14 +178,14 @@ func (client SpatialAnchorsAccountsClient) Delete(ctx context.Context, resourceG } // DeletePreparer prepares the Delete request. -func (client SpatialAnchorsAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (*http.Request, error) { +func (client SpatialAnchorsAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +193,7 @@ func (client SpatialAnchorsAccountsClient) DeletePreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -213,8 +218,8 @@ func (client SpatialAnchorsAccountsClient) DeleteResponder(resp *http.Response) // Get retrieve a Spatial Anchors Account. // Parameters: // resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. -func (client SpatialAnchorsAccountsClient) Get(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (result SpatialAnchorsAccount, err error) { +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result SpatialAnchorsAccount, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.Get") defer func() { @@ -230,14 +235,14 @@ func (client SpatialAnchorsAccountsClient) Get(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, spatialAnchorsAccountName) + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Get", nil, "Failure preparing request") return @@ -260,14 +265,14 @@ func (client SpatialAnchorsAccountsClient) Get(ctx context.Context, resourceGrou } // GetPreparer prepares the Get request. -func (client SpatialAnchorsAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (*http.Request, error) { +func (client SpatialAnchorsAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +280,7 @@ func (client SpatialAnchorsAccountsClient) GetPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -298,104 +303,16 @@ func (client SpatialAnchorsAccountsClient) GetResponder(resp *http.Response) (re return } -// GetKeys get Both of the 2 Keys of a Spatial Anchors Account -// Parameters: -// resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. -func (client SpatialAnchorsAccountsClient) GetKeys(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (result SpatialAnchorsAccountKeys, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.GetKeys") - 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}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "GetKeys", err.Error()) - } - - req, err := client.GetKeysPreparer(ctx, resourceGroupName, spatialAnchorsAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "GetKeys", nil, "Failure preparing request") - return - } - - resp, err := client.GetKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "GetKeys", resp, "Failure sending request") - return - } - - result, err = client.GetKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "GetKeys", resp, "Failure responding to request") - return - } - - return -} - -// GetKeysPreparer prepares the GetKeys request. -func (client SpatialAnchorsAccountsClient) GetKeysPreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-02-28-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.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetKeysSender sends the GetKeys request. The method will close the -// http.Response Body if it receives an error. -func (client SpatialAnchorsAccountsClient) GetKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetKeysResponder handles the response to the GetKeys request. The method always -// closes the http.Response Body. -func (client SpatialAnchorsAccountsClient) GetKeysResponder(resp *http.Response) (result SpatialAnchorsAccountKeys, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListByResourceGroup list Resources by Resource Group // Parameters: // resourceGroupName - name of an Azure resource group. -func (client SpatialAnchorsAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountListPage, err error) { +func (client SpatialAnchorsAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountPagePage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListByResourceGroup") defer func() { sc := -1 - if result.saal.Response.Response != nil { - sc = result.saal.Response.Response.StatusCode + if result.saap.Response.Response != nil { + sc = result.saap.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -417,17 +334,17 @@ func (client SpatialAnchorsAccountsClient) ListByResourceGroup(ctx context.Conte resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.saal.Response = autorest.Response{Response: resp} + result.saap.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", resp, "Failure sending request") return } - result.saal, err = client.ListByResourceGroupResponder(resp) + result.saap, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") return } - if result.saal.hasNextLink() && result.saal.IsEmpty() { + if result.saap.hasNextLink() && result.saap.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -442,7 +359,7 @@ func (client SpatialAnchorsAccountsClient) ListByResourceGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -463,7 +380,7 @@ func (client SpatialAnchorsAccountsClient) ListByResourceGroupSender(req *http.R // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client SpatialAnchorsAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result SpatialAnchorsAccountList, err error) { +func (client SpatialAnchorsAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result SpatialAnchorsAccountPage, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -474,8 +391,8 @@ func (client SpatialAnchorsAccountsClient) ListByResourceGroupResponder(resp *ht } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SpatialAnchorsAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SpatialAnchorsAccountList) (result SpatialAnchorsAccountList, err error) { - req, err := lastResults.spatialAnchorsAccountListPreparer(ctx) +func (client SpatialAnchorsAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SpatialAnchorsAccountPage) (result SpatialAnchorsAccountPage, err error) { + req, err := lastResults.spatialAnchorsAccountPagePreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } @@ -495,7 +412,7 @@ func (client SpatialAnchorsAccountsClient) listByResourceGroupNextResults(ctx co } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SpatialAnchorsAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountListIterator, err error) { +func (client SpatialAnchorsAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountPageIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListByResourceGroup") defer func() { @@ -511,13 +428,13 @@ func (client SpatialAnchorsAccountsClient) ListByResourceGroupComplete(ctx conte } // ListBySubscription list Spatial Anchors Accounts by Subscription -func (client SpatialAnchorsAccountsClient) ListBySubscription(ctx context.Context) (result SpatialAnchorsAccountListPage, err error) { +func (client SpatialAnchorsAccountsClient) ListBySubscription(ctx context.Context) (result SpatialAnchorsAccountPagePage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListBySubscription") defer func() { sc := -1 - if result.saal.Response.Response != nil { - sc = result.saal.Response.Response.StatusCode + if result.saap.Response.Response != nil { + sc = result.saap.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -531,17 +448,17 @@ func (client SpatialAnchorsAccountsClient) ListBySubscription(ctx context.Contex resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.saal.Response = autorest.Response{Response: resp} + result.saap.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListBySubscription", resp, "Failure sending request") return } - result.saal, err = client.ListBySubscriptionResponder(resp) + result.saap, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListBySubscription", resp, "Failure responding to request") return } - if result.saal.hasNextLink() && result.saal.IsEmpty() { + if result.saap.hasNextLink() && result.saap.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -555,7 +472,7 @@ func (client SpatialAnchorsAccountsClient) ListBySubscriptionPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -576,7 +493,7 @@ func (client SpatialAnchorsAccountsClient) ListBySubscriptionSender(req *http.Re // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (client SpatialAnchorsAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result SpatialAnchorsAccountList, err error) { +func (client SpatialAnchorsAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result SpatialAnchorsAccountPage, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -587,8 +504,8 @@ func (client SpatialAnchorsAccountsClient) ListBySubscriptionResponder(resp *htt } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client SpatialAnchorsAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SpatialAnchorsAccountList) (result SpatialAnchorsAccountList, err error) { - req, err := lastResults.spatialAnchorsAccountListPreparer(ctx) +func (client SpatialAnchorsAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SpatialAnchorsAccountPage) (result SpatialAnchorsAccountPage, err error) { + req, err := lastResults.spatialAnchorsAccountPagePreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } @@ -608,7 +525,7 @@ func (client SpatialAnchorsAccountsClient) listBySubscriptionNextResults(ctx con } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client SpatialAnchorsAccountsClient) ListBySubscriptionComplete(ctx context.Context) (result SpatialAnchorsAccountListIterator, err error) { +func (client SpatialAnchorsAccountsClient) ListBySubscriptionComplete(ctx context.Context) (result SpatialAnchorsAccountPageIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListBySubscription") defer func() { @@ -623,12 +540,100 @@ func (client SpatialAnchorsAccountsClient) ListBySubscriptionComplete(ctx contex return } -// RegenerateKeys regenerate 1 Key of a Spatial Anchors Account +// ListKeys list Both of the 2 Keys of a Spatial Anchors Account // Parameters: // resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. -// spatialAnchorsAccountKeyRegenerate - specifying which key to be regenerated. -func (client SpatialAnchorsAccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccountKeyRegenerate SpatialAnchorsAccountKeyRegenerateRequest) (result SpatialAnchorsAccountKeys, err error) { +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client SpatialAnchorsAccountsClient) 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-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKeys regenerate specified Key of a Spatial Anchors Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// regenerate - required information for key regeneration. +func (client SpatialAnchorsAccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (result AccountKeys, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.RegenerateKeys") defer func() { @@ -644,14 +649,14 @@ func (client SpatialAnchorsAccountsClient) RegenerateKeys(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", err.Error()) } - req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccountKeyRegenerate) + req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, regenerate) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", nil, "Failure preparing request") return @@ -674,14 +679,14 @@ func (client SpatialAnchorsAccountsClient) RegenerateKeys(ctx context.Context, r } // RegenerateKeysPreparer prepares the RegenerateKeys request. -func (client SpatialAnchorsAccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccountKeyRegenerate SpatialAnchorsAccountKeyRegenerateRequest) (*http.Request, error) { +func (client SpatialAnchorsAccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -690,8 +695,8 @@ func (client SpatialAnchorsAccountsClient) RegenerateKeysPreparer(ctx context.Co autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys", pathParameters), - autorest.WithJSON(spatialAnchorsAccountKeyRegenerate), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys", pathParameters), + autorest.WithJSON(regenerate), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -704,7 +709,7 @@ func (client SpatialAnchorsAccountsClient) RegenerateKeysSender(req *http.Reques // RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always // closes the http.Response Body. -func (client SpatialAnchorsAccountsClient) RegenerateKeysResponder(resp *http.Response) (result SpatialAnchorsAccountKeys, err error) { +func (client SpatialAnchorsAccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -717,9 +722,9 @@ func (client SpatialAnchorsAccountsClient) RegenerateKeysResponder(resp *http.Re // Update updating a Spatial Anchors Account // Parameters: // resourceGroupName - name of an Azure resource group. -// spatialAnchorsAccountName - name of an Mixed Reality Spatial Anchors Account. +// accountName - name of an Mixed Reality Account. // spatialAnchorsAccount - spatial Anchors Account parameter. -func (client SpatialAnchorsAccountsClient) Update(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { +func (client SpatialAnchorsAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.Update") defer func() { @@ -735,14 +740,14 @@ func (client SpatialAnchorsAccountsClient) Update(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: spatialAnchorsAccountName, - Constraints: []validation.Constraint{{Target: "spatialAnchorsAccountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "spatialAnchorsAccountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount) + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, spatialAnchorsAccount) if err != nil { err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Update", nil, "Failure preparing request") return @@ -765,14 +770,14 @@ func (client SpatialAnchorsAccountsClient) Update(ctx context.Context, resourceG } // UpdatePreparer prepares the Update request. -func (client SpatialAnchorsAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, spatialAnchorsAccountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { +func (client SpatialAnchorsAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "spatialAnchorsAccountName": autorest.Encode("path", spatialAnchorsAccountName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-02-28-preview" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -781,7 +786,7 @@ func (client SpatialAnchorsAccountsClient) UpdatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), autorest.WithJSON(spatialAnchorsAccount), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/version.go similarity index 88% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/version.go index d8202dc5e6d0..0edbef2b1b73 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " mixedreality/2019-02-28-preview" + return "Azure-SDK-For-Go/" + Version() + " mixedreality/2021-01-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index e4aee5ceecd3..011fc0b4204a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -60,6 +60,7 @@ github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media +github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedreality github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql @@ -84,7 +85,6 @@ github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-prev github.com/Azure/azure-sdk-for-go/services/preview/hardwaresecuritymodules/mgmt/2018-10-31-preview/hardwaresecuritymodules github.com/Azure/azure-sdk-for-go/services/preview/keyvault/mgmt/2020-04-01-preview/keyvault github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance -github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2019-06-01/insights github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement github.com/Azure/azure-sdk-for-go/services/preview/policyinsights/mgmt/2019-10-01-preview/policyinsights diff --git a/website/docs/d/spatial_anchors_account.html.markdown b/website/docs/d/spatial_anchors_account.html.markdown new file mode 100644 index 000000000000..83650ea2d1ce --- /dev/null +++ b/website/docs/d/spatial_anchors_account.html.markdown @@ -0,0 +1,48 @@ +--- +subcategory: "Mixed Reality" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_spatial_anchors_account" +description: |- + Get information about an Azure Spatial Anchors Account. +--- + +# azurerm_spatial_anchors_account + +Get information about an Azure Spatial Anchors Account. + +## Example Usage + +```hcl +data "azurerm_spatial_anchors_account" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name +} + +output "account_domain" { + value = data.azurerm_spatial_anchors_account.account_domain +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Spatial Anchors Account. Changing this forces a new resource to be created. Must be globally unique. + +* `resource_group_name` - (Required) The name of the resource group in which to create the Spatial Anchors Account. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the Spatial Anchors Account. + +* `account_domain` - The domain of the Spatial Anchors Account. + +* `account_id` - The account ID of the Spatial Anchors Account. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Spatial Anchors Account. diff --git a/website/docs/r/spatial_anchors_account.html.markdown b/website/docs/r/spatial_anchors_account.html.markdown index ff696cee2c2a..366cdccedf2d 100644 --- a/website/docs/r/spatial_anchors_account.html.markdown +++ b/website/docs/r/spatial_anchors_account.html.markdown @@ -43,6 +43,10 @@ The following attributes are exported: * `id` - The ID of the Spatial Anchors Account. +* `account_domain` - The domain of the Spatial Anchors Account. + +* `account_id` - The account ID of the Spatial Anchors Account. + ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: