From 255245a790ab86a716a7644365d5066447146727 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Apr 2022 06:57:29 +0000 Subject: [PATCH] CodeGen from PR 18614 in Azure/azure-rest-api-specs add API version 2022-05-01 (#18614) * add API version 2022-05-01 * fix readme --- .../servicelinker/CHANGELOG.md | 2 + .../servicelinker/_meta.json | 11 + .../servicelinker/client.go | 39 + .../2021-11-01-preview/servicelinker/enums.go | 161 ++ .../servicelinker/linker.go | 621 ++++++++ .../servicelinker/models.go | 1379 +++++++++++++++++ .../servicelinker/operations.go | 140 ++ .../servicelinkerapi/interfaces.go | 34 + .../servicelinker/version.go | 19 + 9 files changed, 2406 insertions(+) create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/CHANGELOG.md create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/_meta.json create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/client.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/enums.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/linker.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/models.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/operations.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/servicelinkerapi/interfaces.go create mode 100644 services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/version.go diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/CHANGELOG.md b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/_meta.json b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/_meta.json new file mode 100644 index 000000000000..e0f4ea9ce738 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "1f034c929345ef45116f2f835ab2e14dc2c6e560", + "readme": "/_/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md", + "tag": "package-2021-11-01-preview", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-11-01-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/client.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/client.go new file mode 100644 index 000000000000..6d9ce27044ee --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/client.go @@ -0,0 +1,39 @@ +// Package servicelinker implements the Azure ARM Servicelinker service API version 2021-11-01-preview. +// +// Microsoft.ServiceLinker provider +package servicelinker + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Servicelinker + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Servicelinker. +type BaseClient struct { + autorest.Client + BaseURI string +} + +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + } +} diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/enums.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/enums.go new file mode 100644 index 000000000000..317565accae2 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/enums.go @@ -0,0 +1,161 @@ +package servicelinker + +// 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. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal} +} + +// AuthType enumerates the values for auth type. +type AuthType string + +const ( + // Secret ... + Secret AuthType = "secret" + // ServicePrincipalCertificate ... + ServicePrincipalCertificate AuthType = "servicePrincipalCertificate" + // ServicePrincipalSecret ... + ServicePrincipalSecret AuthType = "servicePrincipalSecret" + // SystemAssignedIdentity ... + SystemAssignedIdentity AuthType = "systemAssignedIdentity" + // UserAssignedIdentity ... + UserAssignedIdentity AuthType = "userAssignedIdentity" +) + +// PossibleAuthTypeValues returns an array of possible values for the AuthType const type. +func PossibleAuthTypeValues() []AuthType { + return []AuthType{Secret, ServicePrincipalCertificate, ServicePrincipalSecret, SystemAssignedIdentity, UserAssignedIdentity} +} + +// AuthTypeBasicAuthInfoBase enumerates the values for auth type basic auth info base. +type AuthTypeBasicAuthInfoBase string + +const ( + // AuthTypeAuthInfoBase ... + AuthTypeAuthInfoBase AuthTypeBasicAuthInfoBase = "AuthInfoBase" + // AuthTypeSecret ... + AuthTypeSecret AuthTypeBasicAuthInfoBase = "secret" + // AuthTypeServicePrincipalCertificate ... + AuthTypeServicePrincipalCertificate AuthTypeBasicAuthInfoBase = "servicePrincipalCertificate" + // AuthTypeServicePrincipalSecret ... + AuthTypeServicePrincipalSecret AuthTypeBasicAuthInfoBase = "servicePrincipalSecret" + // AuthTypeSystemAssignedIdentity ... + AuthTypeSystemAssignedIdentity AuthTypeBasicAuthInfoBase = "systemAssignedIdentity" + // AuthTypeUserAssignedIdentity ... + AuthTypeUserAssignedIdentity AuthTypeBasicAuthInfoBase = "userAssignedIdentity" +) + +// PossibleAuthTypeBasicAuthInfoBaseValues returns an array of possible values for the AuthTypeBasicAuthInfoBase const type. +func PossibleAuthTypeBasicAuthInfoBaseValues() []AuthTypeBasicAuthInfoBase { + return []AuthTypeBasicAuthInfoBase{AuthTypeAuthInfoBase, AuthTypeSecret, AuthTypeServicePrincipalCertificate, AuthTypeServicePrincipalSecret, AuthTypeSystemAssignedIdentity, AuthTypeUserAssignedIdentity} +} + +// ClientType enumerates the values for client type. +type ClientType string + +const ( + // Django ... + Django ClientType = "django" + // Dotnet ... + Dotnet ClientType = "dotnet" + // Go ... + Go ClientType = "go" + // Java ... + Java ClientType = "java" + // Nodejs ... + Nodejs ClientType = "nodejs" + // None ... + None ClientType = "none" + // Php ... + Php ClientType = "php" + // Python ... + Python ClientType = "python" + // Ruby ... + Ruby ClientType = "ruby" + // SpringBoot ... + SpringBoot ClientType = "springBoot" +) + +// PossibleClientTypeValues returns an array of possible values for the ClientType const type. +func PossibleClientTypeValues() []ClientType { + return []ClientType{Django, Dotnet, Go, Java, Nodejs, None, Php, Python, Ruby, SpringBoot} +} + +// 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} +} + +// LinkerStatus enumerates the values for linker status. +type LinkerStatus string + +const ( + // Healthy ... + Healthy LinkerStatus = "Healthy" + // Nothealthy ... + Nothealthy LinkerStatus = "Not healthy" +) + +// PossibleLinkerStatusValues returns an array of possible values for the LinkerStatus const type. +func PossibleLinkerStatusValues() []LinkerStatus { + return []LinkerStatus{Healthy, Nothealthy} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginSystem ... + OriginSystem Origin = "system" + // OriginUser ... + OriginUser Origin = "user" + // OriginUsersystem ... + OriginUsersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginSystem, OriginUser, OriginUsersystem} +} + +// VNetSolutionType enumerates the values for v net solution type. +type VNetSolutionType string + +const ( + // PrivateLink ... + PrivateLink VNetSolutionType = "privateLink" + // ServiceEndpoint ... + ServiceEndpoint VNetSolutionType = "serviceEndpoint" +) + +// PossibleVNetSolutionTypeValues returns an array of possible values for the VNetSolutionType const type. +func PossibleVNetSolutionTypeValues() []VNetSolutionType { + return []VNetSolutionType{PrivateLink, ServiceEndpoint} +} diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/linker.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/linker.go new file mode 100644 index 000000000000..9c2ab2c7709b --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/linker.go @@ -0,0 +1,621 @@ +package servicelinker + +// 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" +) + +// LinkerClient is the microsoft.ServiceLinker provider +type LinkerClient struct { + BaseClient +} + +// NewLinkerClient creates an instance of the LinkerClient client. +func NewLinkerClient() LinkerClient { + return NewLinkerClientWithBaseURI(DefaultBaseURI) +} + +// NewLinkerClientWithBaseURI creates an instance of the LinkerClient 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 NewLinkerClientWithBaseURI(baseURI string) LinkerClient { + return LinkerClient{NewWithBaseURI(baseURI)} +} + +// CreateOrUpdate create or update linker resource. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +// parameters - linker details. +func (client LinkerClient) CreateOrUpdate(ctx context.Context, resourceURI string, linkerName string, parameters LinkerResource) (result LinkerCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LinkerProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("servicelinker.LinkerClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceURI, linkerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LinkerClient) CreateOrUpdatePreparer(ctx context.Context, resourceURI string, linkerName string, parameters LinkerResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client LinkerClient) CreateOrUpdateSender(req *http.Request) (future LinkerCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LinkerClient) CreateOrUpdateResponder(resp *http.Response) (result LinkerResource, 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 link. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +func (client LinkerClient) Delete(ctx context.Context, resourceURI string, linkerName string) (result LinkerDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceURI, linkerName) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LinkerClient) DeletePreparer(ctx context.Context, resourceURI string, linkerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", 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 LinkerClient) DeleteSender(req *http.Request) (future LinkerDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LinkerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns Linker resource for a given name. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +func (client LinkerClient) Get(ctx context.Context, resourceURI string, linkerName string) (result LinkerResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceURI, linkerName) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkerClient) GetPreparer(ctx context.Context, resourceURI string, linkerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", 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 LinkerClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LinkerClient) GetResponder(resp *http.Response) (result LinkerResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns list of Linkers which connects to the resource. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +func (client LinkerClient) List(ctx context.Context, resourceURI string) (result LinkerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.List") + defer func() { + sc := -1 + if result.ll.Response.Response != nil { + sc = result.ll.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceURI) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ll.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "List", resp, "Failure sending request") + return + } + + result.ll, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "List", resp, "Failure responding to request") + return + } + if result.ll.hasNextLink() && result.ll.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client LinkerClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LinkerClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LinkerClient) ListResponder(resp *http.Response) (result LinkerList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client LinkerClient) listNextResults(ctx context.Context, lastResults LinkerList) (result LinkerList, err error) { + req, err := lastResults.linkerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client LinkerClient) ListComplete(ctx context.Context, resourceURI string) (result LinkerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceURI) + return +} + +// ListConfigurations list source configurations for a linker. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +func (client LinkerClient) ListConfigurations(ctx context.Context, resourceURI string, linkerName string) (result SourceConfigurationResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.ListConfigurations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListConfigurationsPreparer(ctx, resourceURI, linkerName) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "ListConfigurations", nil, "Failure preparing request") + return + } + + resp, err := client.ListConfigurationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "ListConfigurations", resp, "Failure sending request") + return + } + + result, err = client.ListConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "ListConfigurations", resp, "Failure responding to request") + return + } + + return +} + +// ListConfigurationsPreparer prepares the ListConfigurations request. +func (client LinkerClient) ListConfigurationsPreparer(ctx context.Context, resourceURI string, linkerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConfigurationsSender sends the ListConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client LinkerClient) ListConfigurationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListConfigurationsResponder handles the response to the ListConfigurations request. The method always +// closes the http.Response Body. +func (client LinkerClient) ListConfigurationsResponder(resp *http.Response) (result SourceConfigurationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update operation to update an existing link. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +// parameters - linker details. +func (client LinkerClient) Update(ctx context.Context, resourceURI string, linkerName string, parameters LinkerPatch) (result LinkerUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceURI, linkerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LinkerClient) UpdatePreparer(ctx context.Context, resourceURI string, linkerName string, parameters LinkerPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client LinkerClient) UpdateSender(req *http.Request) (future LinkerUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LinkerClient) UpdateResponder(resp *http.Response) (result LinkerResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Validate validate a link. +// Parameters: +// resourceURI - the fully qualified Azure Resource manager identifier of the resource to be connected. +// linkerName - the name Linker resource. +func (client LinkerClient) Validate(ctx context.Context, resourceURI string, linkerName string) (result LinkerValidateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerClient.Validate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidatePreparer(ctx, resourceURI, linkerName) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Validate", nil, "Failure preparing request") + return + } + + result, err = client.ValidateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerClient", "Validate", result.Response(), "Failure sending request") + return + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client LinkerClient) ValidatePreparer(ctx context.Context, resourceURI string, linkerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkerName": autorest.Encode("path", linkerName), + "resourceUri": resourceURI, + } + + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client LinkerClient) ValidateSender(req *http.Request) (future LinkerValidateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client LinkerClient) ValidateResponder(resp *http.Response) (result ValidateResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/models.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/models.go new file mode 100644 index 000000000000..0ac0b07c0934 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/models.go @@ -0,0 +1,1379 @@ +package servicelinker + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker" + +// BasicAuthInfoBase the authentication info +type BasicAuthInfoBase interface { + AsSecretAuthInfo() (*SecretAuthInfo, bool) + AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) + AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) + AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) + AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) + AsAuthInfoBase() (*AuthInfoBase, bool) +} + +// AuthInfoBase the authentication info +type AuthInfoBase struct { + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +func unmarshalBasicAuthInfoBase(body []byte) (BasicAuthInfoBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["authType"] { + case string(AuthTypeSecret): + var sai SecretAuthInfo + err := json.Unmarshal(body, &sai) + return sai, err + case string(AuthTypeUserAssignedIdentity): + var uaiai UserAssignedIdentityAuthInfo + err := json.Unmarshal(body, &uaiai) + return uaiai, err + case string(AuthTypeSystemAssignedIdentity): + var saiai SystemAssignedIdentityAuthInfo + err := json.Unmarshal(body, &saiai) + return saiai, err + case string(AuthTypeServicePrincipalSecret): + var spsai ServicePrincipalSecretAuthInfo + err := json.Unmarshal(body, &spsai) + return spsai, err + case string(AuthTypeServicePrincipalCertificate): + var spcai ServicePrincipalCertificateAuthInfo + err := json.Unmarshal(body, &spcai) + return spcai, err + default: + var aib AuthInfoBase + err := json.Unmarshal(body, &aib) + return aib, err + } +} +func unmarshalBasicAuthInfoBaseArray(body []byte) ([]BasicAuthInfoBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aibArray := make([]BasicAuthInfoBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aib, err := unmarshalBasicAuthInfoBase(*rawMessage) + if err != nil { + return nil, err + } + aibArray[index] = aib + } + return aibArray, nil +} + +// MarshalJSON is the custom marshaler for AuthInfoBase. +func (aib AuthInfoBase) MarshalJSON() ([]byte, error) { + aib.AuthType = AuthTypeAuthInfoBase + objectMap := make(map[string]interface{}) + if aib.AuthType != "" { + objectMap["authType"] = aib.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return nil, false +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return nil, false +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsAuthInfoBase() (*AuthInfoBase, bool) { + return &aib, true +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for AuthInfoBase. +func (aib AuthInfoBase) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &aib, true +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// LinkerCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LinkerCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LinkerClient) (LinkerResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LinkerCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LinkerCreateOrUpdateFuture.Result. +func (future *LinkerCreateOrUpdateFuture) result(client LinkerClient) (lr LinkerResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("servicelinker.LinkerCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lr.Response.Response, err = future.GetResult(sender); err == nil && lr.Response.Response.StatusCode != http.StatusNoContent { + lr, err = client.CreateOrUpdateResponder(lr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerCreateOrUpdateFuture", "Result", lr.Response.Response, "Failure responding to request") + } + } + return +} + +// LinkerDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LinkerDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LinkerClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LinkerDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LinkerDeleteFuture.Result. +func (future *LinkerDeleteFuture) result(client LinkerClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("servicelinker.LinkerDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LinkerList the list of Linker. +type LinkerList struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of Linker list. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of Linkers. + Value *[]LinkerResource `json:"value,omitempty"` +} + +// LinkerListIterator provides access to a complete listing of LinkerResource values. +type LinkerListIterator struct { + i int + page LinkerListPage +} + +// 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 *LinkerListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerListIterator.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 *LinkerListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LinkerListIterator) 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 LinkerListIterator) Response() LinkerList { + 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 LinkerListIterator) Value() LinkerResource { + if !iter.page.NotDone() { + return LinkerResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LinkerListIterator type. +func NewLinkerListIterator(page LinkerListPage) LinkerListIterator { + return LinkerListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ll LinkerList) IsEmpty() bool { + return ll.Value == nil || len(*ll.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ll LinkerList) hasNextLink() bool { + return ll.NextLink != nil && len(*ll.NextLink) != 0 +} + +// linkerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ll LinkerList) linkerListPreparer(ctx context.Context) (*http.Request, error) { + if !ll.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ll.NextLink))) +} + +// LinkerListPage contains a page of LinkerResource values. +type LinkerListPage struct { + fn func(context.Context, LinkerList) (LinkerList, error) + ll LinkerList +} + +// 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 *LinkerListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkerListPage.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.ll) + if err != nil { + return err + } + page.ll = 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 *LinkerListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LinkerListPage) NotDone() bool { + return !page.ll.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LinkerListPage) Response() LinkerList { + return page.ll +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LinkerListPage) Values() []LinkerResource { + if page.ll.IsEmpty() { + return nil + } + return *page.ll.Value +} + +// Creates a new instance of the LinkerListPage type. +func NewLinkerListPage(cur LinkerList, getNextPage func(context.Context, LinkerList) (LinkerList, error)) LinkerListPage { + return LinkerListPage{ + fn: getNextPage, + ll: cur, + } +} + +// LinkerPatch a linker to be updated. +type LinkerPatch struct { + // LinkerProperties - Linker properties + *LinkerProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkerPatch. +func (lp LinkerPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lp.LinkerProperties != nil { + objectMap["properties"] = lp.LinkerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LinkerPatch struct. +func (lp *LinkerPatch) UnmarshalJSON(body []byte) error { + 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 linkerProperties LinkerProperties + err = json.Unmarshal(*v, &linkerProperties) + if err != nil { + return err + } + lp.LinkerProperties = &linkerProperties + } + } + } + + return nil +} + +// LinkerProperties the properties of the linker. +type LinkerProperties struct { + // TargetID - The resource Id of target service. + TargetID *string `json:"targetId,omitempty"` + // AuthInfo - The authentication type. + AuthInfo BasicAuthInfoBase `json:"authInfo,omitempty"` + // ClientType - The application client type. Possible values include: 'None', 'Dotnet', 'Java', 'Python', 'Go', 'Php', 'Ruby', 'Django', 'Nodejs', 'SpringBoot' + ClientType ClientType `json:"clientType,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // VNetSolution - The VNet solution. + VNetSolution *VNetSolution `json:"vNetSolution,omitempty"` + // SecretStore - An option to store secret value in secure place + SecretStore *SecretStore `json:"secretStore,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkerProperties. +func (lp LinkerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lp.TargetID != nil { + objectMap["targetId"] = lp.TargetID + } + objectMap["authInfo"] = lp.AuthInfo + if lp.ClientType != "" { + objectMap["clientType"] = lp.ClientType + } + if lp.VNetSolution != nil { + objectMap["vNetSolution"] = lp.VNetSolution + } + if lp.SecretStore != nil { + objectMap["secretStore"] = lp.SecretStore + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LinkerProperties struct. +func (lp *LinkerProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "targetId": + if v != nil { + var targetID string + err = json.Unmarshal(*v, &targetID) + if err != nil { + return err + } + lp.TargetID = &targetID + } + case "authInfo": + if v != nil { + authInfo, err := unmarshalBasicAuthInfoBase(*v) + if err != nil { + return err + } + lp.AuthInfo = authInfo + } + case "clientType": + if v != nil { + var clientType ClientType + err = json.Unmarshal(*v, &clientType) + if err != nil { + return err + } + lp.ClientType = clientType + } + case "provisioningState": + if v != nil { + var provisioningState string + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + lp.ProvisioningState = &provisioningState + } + case "vNetSolution": + if v != nil { + var vNetSolution VNetSolution + err = json.Unmarshal(*v, &vNetSolution) + if err != nil { + return err + } + lp.VNetSolution = &vNetSolution + } + case "secretStore": + if v != nil { + var secretStore SecretStore + err = json.Unmarshal(*v, &secretStore) + if err != nil { + return err + } + lp.SecretStore = &secretStore + } + } + } + + return nil +} + +// LinkerResource linker of source and target resource +type LinkerResource struct { + autorest.Response `json:"-"` + // LinkerProperties - The properties of the linker. + *LinkerProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system data. + SystemData *SystemData `json:"systemData,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 LinkerResource. +func (lr LinkerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.LinkerProperties != nil { + objectMap["properties"] = lr.LinkerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LinkerResource struct. +func (lr *LinkerResource) UnmarshalJSON(body []byte) error { + 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 linkerProperties LinkerProperties + err = json.Unmarshal(*v, &linkerProperties) + if err != nil { + return err + } + lr.LinkerProperties = &linkerProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + lr.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lr.Type = &typeVar + } + } + } + + return nil +} + +// LinkerUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LinkerUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LinkerClient) (LinkerResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LinkerUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LinkerUpdateFuture.Result. +func (future *LinkerUpdateFuture) result(client LinkerClient) (lr LinkerResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("servicelinker.LinkerUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lr.Response.Response, err = future.GetResult(sender); err == nil && lr.Response.Response.StatusCode != http.StatusNoContent { + lr, err = client.UpdateResponder(lr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerUpdateFuture", "Result", lr.Response.Response, "Failure responding to request") + } + } + return +} + +// LinkerValidateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LinkerValidateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LinkerClient) (ValidateResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LinkerValidateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LinkerValidateFuture.Result. +func (future *LinkerValidateFuture) result(client LinkerClient) (vr ValidateResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerValidateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("servicelinker.LinkerValidateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vr.Response.Response, err = future.GetResult(sender); err == nil && vr.Response.Response.StatusCode != http.StatusNoContent { + vr, err = client.ValidateResponder(vr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.LinkerValidateFuture", "Result", vr.Response.Response, "Failure responding to request") + } + } + return +} + +// Operation details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'OriginUser', 'OriginSystem', 'OriginUsersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'Internal' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay localized display information for this particular operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the resource provider + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SecretAuthInfo the authentication info when authType is secret +type SecretAuthInfo struct { + // Name - Username or account name for secret auth. + Name *string `json:"name,omitempty"` + // Secret - Password or account key for secret auth. + Secret *string `json:"secret,omitempty"` + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecretAuthInfo. +func (sai SecretAuthInfo) MarshalJSON() ([]byte, error) { + sai.AuthType = AuthTypeSecret + objectMap := make(map[string]interface{}) + if sai.Name != nil { + objectMap["name"] = sai.Name + } + if sai.Secret != nil { + objectMap["secret"] = sai.Secret + } + if sai.AuthType != "" { + objectMap["authType"] = sai.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return &sai, true +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return nil, false +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsAuthInfoBase() (*AuthInfoBase, bool) { + return nil, false +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for SecretAuthInfo. +func (sai SecretAuthInfo) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &sai, true +} + +// SecretStore an option to store secret value in secure place +type SecretStore struct { + // KeyVaultID - The key vault id to store secret + KeyVaultID *string `json:"keyVaultId,omitempty"` +} + +// ServicePrincipalCertificateAuthInfo the authentication info when authType is servicePrincipal +// certificate +type ServicePrincipalCertificateAuthInfo struct { + // ClientID - Application clientId for servicePrincipal auth. + ClientID *string `json:"clientId,omitempty"` + // PrincipalID - Principal Id for servicePrincipal auth. + PrincipalID *string `json:"principalId,omitempty"` + // Certificate - ServicePrincipal certificate for servicePrincipal auth. + Certificate *string `json:"certificate,omitempty"` + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) MarshalJSON() ([]byte, error) { + spcai.AuthType = AuthTypeServicePrincipalCertificate + objectMap := make(map[string]interface{}) + if spcai.ClientID != nil { + objectMap["clientId"] = spcai.ClientID + } + if spcai.PrincipalID != nil { + objectMap["principalId"] = spcai.PrincipalID + } + if spcai.Certificate != nil { + objectMap["certificate"] = spcai.Certificate + } + if spcai.AuthType != "" { + objectMap["authType"] = spcai.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return nil, false +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return &spcai, true +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsAuthInfoBase() (*AuthInfoBase, bool) { + return nil, false +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for ServicePrincipalCertificateAuthInfo. +func (spcai ServicePrincipalCertificateAuthInfo) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &spcai, true +} + +// ServicePrincipalSecretAuthInfo the authentication info when authType is servicePrincipal secret +type ServicePrincipalSecretAuthInfo struct { + // ClientID - ServicePrincipal application clientId for servicePrincipal auth. + ClientID *string `json:"clientId,omitempty"` + // PrincipalID - Principal Id for servicePrincipal auth. + PrincipalID *string `json:"principalId,omitempty"` + // Secret - Secret for servicePrincipal auth. + Secret *string `json:"secret,omitempty"` + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) MarshalJSON() ([]byte, error) { + spsai.AuthType = AuthTypeServicePrincipalSecret + objectMap := make(map[string]interface{}) + if spsai.ClientID != nil { + objectMap["clientId"] = spsai.ClientID + } + if spsai.PrincipalID != nil { + objectMap["principalId"] = spsai.PrincipalID + } + if spsai.Secret != nil { + objectMap["secret"] = spsai.Secret + } + if spsai.AuthType != "" { + objectMap["authType"] = spsai.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return nil, false +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return &spsai, true +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return nil, false +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsAuthInfoBase() (*AuthInfoBase, bool) { + return nil, false +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for ServicePrincipalSecretAuthInfo. +func (spsai ServicePrincipalSecretAuthInfo) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &spsai, true +} + +// SourceConfiguration a configuration item for source resource +type SourceConfiguration struct { + // Name - The name of setting. + Name *string `json:"name,omitempty"` + // Value - The value of setting + Value *string `json:"value,omitempty"` +} + +// SourceConfigurationResult configurations for source resource, include appSettings, connectionString and +// serviceBindings +type SourceConfigurationResult struct { + autorest.Response `json:"-"` + // Configurations - The configuration properties for source resource. + Configurations *[]SourceConfiguration `json:"configurations,omitempty"` +} + +// SystemAssignedIdentityAuthInfo the authentication info when authType is systemAssignedIdentity +type SystemAssignedIdentityAuthInfo struct { + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { + saiai.AuthType = AuthTypeSystemAssignedIdentity + objectMap := make(map[string]interface{}) + if saiai.AuthType != "" { + objectMap["authType"] = saiai.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return nil, false +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return &saiai, true +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return nil, false +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsAuthInfoBase() (*AuthInfoBase, bool) { + return nil, false +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for SystemAssignedIdentityAuthInfo. +func (saiai SystemAssignedIdentityAuthInfo) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &saiai, true +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UserAssignedIdentityAuthInfo the authentication info when authType is userAssignedIdentity +type UserAssignedIdentityAuthInfo struct { + // ClientID - Client Id for userAssignedIdentity. + ClientID *string `json:"clientId,omitempty"` + // SubscriptionID - Subscription id for userAssignedIdentity. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // AuthType - Possible values include: 'AuthTypeAuthInfoBase', 'AuthTypeSecret', 'AuthTypeUserAssignedIdentity', 'AuthTypeSystemAssignedIdentity', 'AuthTypeServicePrincipalSecret', 'AuthTypeServicePrincipalCertificate' + AuthType AuthTypeBasicAuthInfoBase `json:"authType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { + uaiai.AuthType = AuthTypeUserAssignedIdentity + objectMap := make(map[string]interface{}) + if uaiai.ClientID != nil { + objectMap["clientId"] = uaiai.ClientID + } + if uaiai.SubscriptionID != nil { + objectMap["subscriptionId"] = uaiai.SubscriptionID + } + if uaiai.AuthType != "" { + objectMap["authType"] = uaiai.AuthType + } + return json.Marshal(objectMap) +} + +// AsSecretAuthInfo is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsSecretAuthInfo() (*SecretAuthInfo, bool) { + return nil, false +} + +// AsUserAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsUserAssignedIdentityAuthInfo() (*UserAssignedIdentityAuthInfo, bool) { + return &uaiai, true +} + +// AsSystemAssignedIdentityAuthInfo is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsSystemAssignedIdentityAuthInfo() (*SystemAssignedIdentityAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalSecretAuthInfo is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsServicePrincipalSecretAuthInfo() (*ServicePrincipalSecretAuthInfo, bool) { + return nil, false +} + +// AsServicePrincipalCertificateAuthInfo is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsServicePrincipalCertificateAuthInfo() (*ServicePrincipalCertificateAuthInfo, bool) { + return nil, false +} + +// AsAuthInfoBase is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsAuthInfoBase() (*AuthInfoBase, bool) { + return nil, false +} + +// AsBasicAuthInfoBase is the BasicAuthInfoBase implementation for UserAssignedIdentityAuthInfo. +func (uaiai UserAssignedIdentityAuthInfo) AsBasicAuthInfoBase() (BasicAuthInfoBase, bool) { + return &uaiai, true +} + +// ValidateResult the validation result for a linker. +type ValidateResult struct { + autorest.Response `json:"-"` + // Name - The linker name. + Name *string `json:"name,omitempty"` + // LinkerStatus - Specifies if the linker is healthy. Possible values include: 'Healthy', 'Nothealthy' + LinkerStatus LinkerStatus `json:"linkerStatus,omitempty"` + // Reason - The reason of the error. + Reason *string `json:"reason,omitempty"` + // ReportStartTimeUtc - The start time of the validation report. + ReportStartTimeUtc *date.Time `json:"reportStartTimeUtc,omitempty"` + // ReportEndTimeUtc - The end time of the validation report. + ReportEndTimeUtc *date.Time `json:"reportEndTimeUtc,omitempty"` + // TargetID - The resource Id of target service. + TargetID *string `json:"targetId,omitempty"` + // AuthType - The authentication type. Possible values include: 'SystemAssignedIdentity', 'UserAssignedIdentity', 'ServicePrincipalSecret', 'ServicePrincipalCertificate', 'Secret' + AuthType AuthType `json:"authType,omitempty"` +} + +// VNetSolution the VNet solution for linker +type VNetSolution struct { + // Type - Type of VNet solution. Possible values include: 'ServiceEndpoint', 'PrivateLink' + Type VNetSolutionType `json:"type,omitempty"` +} diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/operations.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/operations.go new file mode 100644 index 000000000000..3204a8465015 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/operations.go @@ -0,0 +1,140 @@ +package servicelinker + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the microsoft.ServiceLinker provider +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient() OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI)} +} + +// List lists the available ServiceLinker REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ServiceLinker/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicelinker.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/servicelinkerapi/interfaces.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/servicelinkerapi/interfaces.go new file mode 100644 index 000000000000..8ee6d6e02c0a --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/servicelinkerapi/interfaces.go @@ -0,0 +1,34 @@ +package servicelinkerapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker" +) + +// LinkerClientAPI contains the set of methods on the LinkerClient type. +type LinkerClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceURI string, linkerName string, parameters servicelinker.LinkerResource) (result servicelinker.LinkerCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceURI string, linkerName string) (result servicelinker.LinkerDeleteFuture, err error) + Get(ctx context.Context, resourceURI string, linkerName string) (result servicelinker.LinkerResource, err error) + List(ctx context.Context, resourceURI string) (result servicelinker.LinkerListPage, err error) + ListComplete(ctx context.Context, resourceURI string) (result servicelinker.LinkerListIterator, err error) + ListConfigurations(ctx context.Context, resourceURI string, linkerName string) (result servicelinker.SourceConfigurationResult, err error) + Update(ctx context.Context, resourceURI string, linkerName string, parameters servicelinker.LinkerPatch) (result servicelinker.LinkerUpdateFuture, err error) + Validate(ctx context.Context, resourceURI string, linkerName string) (result servicelinker.LinkerValidateFuture, err error) +} + +var _ LinkerClientAPI = (*servicelinker.LinkerClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result servicelinker.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result servicelinker.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*servicelinker.OperationsClient)(nil) diff --git a/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/version.go b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/version.go new file mode 100644 index 000000000000..bd987b3be829 --- /dev/null +++ b/services/preview/servicelinker/mgmt/2021-11-01-preview/servicelinker/version.go @@ -0,0 +1,19 @@ +package servicelinker + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " servicelinker/2021-11-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}