diff --git a/services/web/mgmt/2019-08-01/web/apps.go b/services/web/mgmt/2019-08-01/web/apps.go index 47ad23bfd369..3c0c778a96e3 100644 --- a/services/web/mgmt/2019-08-01/web/apps.go +++ b/services/web/mgmt/2019-08-01/web/apps.go @@ -583,6 +583,93 @@ func (client AppsClient) ApplySlotConfigurationSlotResponder(resp *http.Response return } +// ApproveOrRejectPrivateEndpointConnection description for Approves or rejects a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (result AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ApproveOrRejectPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", err.Error()) + } + + req, err := client.ApproveOrRejectPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.ApproveOrRejectPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionPreparer prepares the ApproveOrRejectPrivateEndpointConnection request. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointWrapper), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApproveOrRejectPrivateEndpointConnectionSender sends the ApproveOrRejectPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSender(req *http.Request) (future AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ApproveOrRejectPrivateEndpointConnectionResponder handles the response to the ApproveOrRejectPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Backup description for Creates a backup of an app. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -6303,6 +6390,91 @@ func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (r return } +// DeletePrivateEndpointConnection description for Deletes a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result AppsDeletePrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePrivateEndpointConnection", err.Error()) + } + + req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.DeletePrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. +func (client AppsClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future AppsDeletePrivateEndpointConnectionFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // DeleteProcess description for Terminate a process by its ID for a web site, or a deployment slot, or specific // scaled-out instance in a web site. // Parameters: @@ -13458,6 +13630,175 @@ func (client AppsClient) GetPrivateAccessSlotResponder(resp *http.Response) (res return } +// GetPrivateEndpointConnection description for Gets a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result PrivateEndpointConnectionResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateEndpointConnection", err.Error()) + } + + req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") + } + + return +} + +// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. +func (client AppsClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResources description for Gets the private link resources +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result PrivateLinkResourcesWrapper, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateLinkResources", err.Error()) + } + + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", resp, "Failure responding to request") + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client AppsClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourcesWrapper, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetProcess description for Get process information by its ID for a specific scaled-out instance in a web site. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2019-08-01/web/models.go b/services/web/mgmt/2019-08-01/web/models.go index d11509b0d645..cfbd146bda43 100644 --- a/services/web/mgmt/2019-08-01/web/models.go +++ b/services/web/mgmt/2019-08-01/web/models.go @@ -187,6 +187,31 @@ func PossibleBackupRestoreOperationTypeValues() []BackupRestoreOperationType { return []BackupRestoreOperationType{BackupRestoreOperationTypeClone, BackupRestoreOperationTypeCloudFS, BackupRestoreOperationTypeDefault, BackupRestoreOperationTypeRelocation, BackupRestoreOperationTypeSnapshot} } +// BuildStatus enumerates the values for build status. +type BuildStatus string + +const ( + // BuildStatusDeleting ... + BuildStatusDeleting BuildStatus = "Deleting" + // BuildStatusDeploying ... + BuildStatusDeploying BuildStatus = "Deploying" + // BuildStatusDetached ... + BuildStatusDetached BuildStatus = "Detached" + // BuildStatusFailed ... + BuildStatusFailed BuildStatus = "Failed" + // BuildStatusReady ... + BuildStatusReady BuildStatus = "Ready" + // BuildStatusUploading ... + BuildStatusUploading BuildStatus = "Uploading" + // BuildStatusWaitingForDeployment ... + BuildStatusWaitingForDeployment BuildStatus = "WaitingForDeployment" +) + +// PossibleBuildStatusValues returns an array of possible values for the BuildStatus const type. +func PossibleBuildStatusValues() []BuildStatus { + return []BuildStatus{BuildStatusDeleting, BuildStatusDeploying, BuildStatusDetached, BuildStatusFailed, BuildStatusReady, BuildStatusUploading, BuildStatusWaitingForDeployment} +} + // BuiltInAuthenticationProvider enumerates the values for built in authentication provider. type BuiltInAuthenticationProvider string @@ -1321,6 +1346,21 @@ func PossibleTriggeredWebJobStatusValues() []TriggeredWebJobStatus { return []TriggeredWebJobStatus{TriggeredWebJobStatusError, TriggeredWebJobStatusFailed, TriggeredWebJobStatusSuccess} } +// TriggerTypes enumerates the values for trigger types. +type TriggerTypes string + +const ( + // TriggerTypesHTTPTrigger ... + TriggerTypesHTTPTrigger TriggerTypes = "HttpTrigger" + // TriggerTypesUnknown ... + TriggerTypesUnknown TriggerTypes = "Unknown" +) + +// PossibleTriggerTypesValues returns an array of possible values for the TriggerTypes const type. +func PossibleTriggerTypesValues() []TriggerTypes { + return []TriggerTypes{TriggerTypesHTTPTrigger, TriggerTypesUnknown} +} + // UnauthenticatedClientAction enumerates the values for unauthenticated client action. type UnauthenticatedClientAction string @@ -2205,6 +2245,35 @@ func (asr *ApplicationStackResource) UnmarshalJSON(body []byte) error { return nil } +// AppsApproveOrRejectPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AppsApproveOrRejectPrivateEndpointConnectionFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsApproveOrRejectPrivateEndpointConnectionFuture) Result(client AppsClient) (pecr PrivateEndpointConnectionResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("web.AppsApproveOrRejectPrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecr.Response.Response, err = future.GetResult(sender); err == nil && pecr.Response.Response.StatusCode != http.StatusNoContent { + pecr, err = client.ApproveOrRejectPrivateEndpointConnectionResponder(pecr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionFuture", "Result", pecr.Response.Response, "Failure responding to request") + } + } + return +} + // AppsCopyProductionSlotFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AppsCopyProductionSlotFuture struct { @@ -2541,6 +2610,35 @@ func (future *AppsCreateOrUpdateSourceControlSlotFuture) Result(client AppsClien return } +// AppsDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsDeletePrivateEndpointConnectionFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AppsDeletePrivateEndpointConnectionFuture) Result(client AppsClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("web.AppsDeletePrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeletePrivateEndpointConnectionResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + // AppServiceCertificate key Vault container for a certificate that is purchased through Azure. type AppServiceCertificate struct { // KeyVaultID - Key Vault resource Id. @@ -5157,6 +5255,12 @@ func (future *AppsSwapSlotWithProductionFuture) Result(client AppsClient) (ar au return } +// ArmIDWrapper a wrapper for an ARM resource id +type ArmIDWrapper struct { + // ID - READ-ONLY + ID *string `json:"id,omitempty"` +} + // AutoHealActions actions which to take by the auto-heal module when a rule is triggered. type AutoHealActions struct { // ActionType - Predefined action to be taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' @@ -14459,6 +14563,220 @@ type PrivateAccessVirtualNetwork struct { Subnets *[]PrivateAccessSubnet `json:"subnets,omitempty"` } +// PrivateEndpointConnectionResource private Endpoint Connection ARM resource. +type PrivateEndpointConnectionResource struct { + autorest.Response `json:"-"` + // RemotePrivateEndpointConnection - Core resource properties + *RemotePrivateEndpointConnection `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionResource. +func (pecr PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecr.RemotePrivateEndpointConnection != nil { + objectMap["properties"] = pecr.RemotePrivateEndpointConnection + } + if pecr.Kind != nil { + objectMap["kind"] = pecr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionResource struct. +func (pecr *PrivateEndpointConnectionResource) UnmarshalJSON(body []byte) error { + 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 remotePrivateEndpointConnection RemotePrivateEndpointConnection + err = json.Unmarshal(*v, &remotePrivateEndpointConnection) + if err != nil { + return err + } + pecr.RemotePrivateEndpointConnection = &remotePrivateEndpointConnection + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pecr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pecr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pecr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pecr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkConnectionApprovalRequest a request to approve or reject a private endpoint connection +type PrivateLinkConnectionApprovalRequest struct { + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateLinkConnectionApprovalRequestResource private Endpoint Connection Approval ARM resource. +type PrivateLinkConnectionApprovalRequestResource struct { + // PrivateLinkConnectionApprovalRequest - Core resource properties + *PrivateLinkConnectionApprovalRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkConnectionApprovalRequestResource. +func (plcarr PrivateLinkConnectionApprovalRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plcarr.PrivateLinkConnectionApprovalRequest != nil { + objectMap["properties"] = plcarr.PrivateLinkConnectionApprovalRequest + } + if plcarr.Kind != nil { + objectMap["kind"] = plcarr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkConnectionApprovalRequestResource struct. +func (plcarr *PrivateLinkConnectionApprovalRequestResource) UnmarshalJSON(body []byte) error { + 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 privateLinkConnectionApprovalRequest PrivateLinkConnectionApprovalRequest + err = json.Unmarshal(*v, &privateLinkConnectionApprovalRequest) + if err != nil { + return err + } + plcarr.PrivateLinkConnectionApprovalRequest = &privateLinkConnectionApprovalRequest + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plcarr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plcarr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + plcarr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plcarr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkConnectionState the state of a private link connection +type PrivateLinkConnectionState struct { + // Status - Status of a private link connection + Status *string `json:"status,omitempty"` + // Description - Description of a private link connection + Description *string `json:"description,omitempty"` + // ActionsRequired - ActionsRequired for a private link connection + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + ID *string `json:"id,omitempty"` + // Name - Name of a private link resource + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + // Properties - Properties of a private link resource + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; GroupId of a private link resource + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; RequiredMembers of a private link resource + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; RequiredZoneNames of a private link resource + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// PrivateLinkResourcesWrapper wrapper for a collection of private link resources +type PrivateLinkResourcesWrapper struct { + autorest.Response `json:"-"` + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + // ProcessInfo process Information. type ProcessInfo struct { autorest.Response `json:"-"` @@ -16381,6 +16699,15 @@ type RelayServiceConnectionEntityProperties struct { BiztalkURI *string `json:"biztalkUri,omitempty"` } +// RemotePrivateEndpointConnection a remote private endpoint connection +type RemotePrivateEndpointConnection struct { + // ProvisioningState - READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty"` + // PrivateEndpoint - PrivateEndpoint of a remote private endpoint connection + PrivateEndpoint *ArmIDWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + // Rendering instructions for rendering the data type Rendering struct { // Type - Rendering Type. Possible values include: 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' @@ -17676,6 +18003,8 @@ type SiteConfig struct { PythonVersion *string `json:"pythonVersion,omitempty"` // NodeVersion - Version of Node.js. NodeVersion *string `json:"nodeVersion,omitempty"` + // PowerShellVersion - Version of PowerShell. + PowerShellVersion *string `json:"powerShellVersion,omitempty"` // LinuxFxVersion - Linux App Framework and version LinuxFxVersion *string `json:"linuxFxVersion,omitempty"` // WindowsFxVersion - Xenon App Framework and version @@ -20724,6 +21053,1669 @@ func NewStampCapacityCollectionPage(getNextPage func(context.Context, StampCapac return StampCapacityCollectionPage{fn: getNextPage} } +// StaticSite a static site. +type StaticSite struct { + // DefaultHostname - READ-ONLY; The default autogenerated hostname for the static site. + DefaultHostname *string `json:"defaultHostname,omitempty"` + // RepositoryURL - URL for the repository of the static site. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The target branch in the repository. + Branch *string `json:"branch,omitempty"` + // CustomDomains - READ-ONLY; The custom domains associated with this static site. + CustomDomains *[]string `json:"customDomains,omitempty"` + // RepositoryToken - A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + RepositoryToken *string `json:"repositoryToken,omitempty"` + // BuildProperties - Build properties to configure on the repository. + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` +} + +// StaticSiteARMResource static Site ARM resource. +type StaticSiteARMResource struct { + autorest.Response `json:"-"` + // StaticSite - Core resource properties + *StaticSite `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StaticSiteARMResource. +func (ssar StaticSiteARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssar.StaticSite != nil { + objectMap["properties"] = ssar.StaticSite + } + if ssar.Sku != nil { + objectMap["sku"] = ssar.Sku + } + if ssar.Kind != nil { + objectMap["kind"] = ssar.Kind + } + if ssar.Location != nil { + objectMap["location"] = ssar.Location + } + if ssar.Tags != nil { + objectMap["tags"] = ssar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteARMResource struct. +func (ssar *StaticSiteARMResource) UnmarshalJSON(body []byte) error { + 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 staticSite StaticSite + err = json.Unmarshal(*v, &staticSite) + if err != nil { + return err + } + ssar.StaticSite = &staticSite + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + ssar.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssar.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ssar.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssar.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ssar.Tags = tags + } + } + } + + return nil +} + +// StaticSiteBuildARMResource static Site Build ARM resource. +type StaticSiteBuildARMResource struct { + autorest.Response `json:"-"` + // StaticSiteBuildARMResourceProperties - StaticSiteBuildARMResource resource specific properties + *StaticSiteBuildARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteBuildARMResource. +func (ssbar StaticSiteBuildARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssbar.StaticSiteBuildARMResourceProperties != nil { + objectMap["properties"] = ssbar.StaticSiteBuildARMResourceProperties + } + if ssbar.Kind != nil { + objectMap["kind"] = ssbar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteBuildARMResource struct. +func (ssbar *StaticSiteBuildARMResource) UnmarshalJSON(body []byte) error { + 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 staticSiteBuildARMResourceProperties StaticSiteBuildARMResourceProperties + err = json.Unmarshal(*v, &staticSiteBuildARMResourceProperties) + if err != nil { + return err + } + ssbar.StaticSiteBuildARMResourceProperties = &staticSiteBuildARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssbar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssbar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssbar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssbar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteBuildARMResourceProperties staticSiteBuildARMResource resource specific properties +type StaticSiteBuildARMResourceProperties struct { + // BuildID - READ-ONLY; An identifier for the static site build. + BuildID *string `json:"buildId,omitempty"` + // SourceBranch - READ-ONLY; The source branch. + SourceBranch *string `json:"sourceBranch,omitempty"` + // PullRequestTitle - READ-ONLY; The title of a pull request that a static site build is related to. + PullRequestTitle *string `json:"pullRequestTitle,omitempty"` + // Hostname - READ-ONLY; The hostname for a static site build. + Hostname *string `json:"hostname,omitempty"` + // CreatedTimeUtc - READ-ONLY; When this build was created. + CreatedTimeUtc *date.Time `json:"createdTimeUtc,omitempty"` + // LastUpdatedOn - READ-ONLY; When this build was updated. + LastUpdatedOn *date.Time `json:"lastUpdatedOn,omitempty"` + // Status - READ-ONLY; The status of the static site build. Possible values include: 'BuildStatusWaitingForDeployment', 'BuildStatusUploading', 'BuildStatusDeploying', 'BuildStatusReady', 'BuildStatusFailed', 'BuildStatusDeleting', 'BuildStatusDetached' + Status BuildStatus `json:"status,omitempty"` +} + +// StaticSiteBuildCollection collection of static site builds. +type StaticSiteBuildCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteBuildARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticSiteBuildCollectionIterator provides access to a complete listing of StaticSiteBuildARMResource +// values. +type StaticSiteBuildCollectionIterator struct { + i int + page StaticSiteBuildCollectionPage +} + +// 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 *StaticSiteBuildCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteBuildCollectionIterator.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 *StaticSiteBuildCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteBuildCollectionIterator) 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 StaticSiteBuildCollectionIterator) Response() StaticSiteBuildCollection { + 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 StaticSiteBuildCollectionIterator) Value() StaticSiteBuildARMResource { + if !iter.page.NotDone() { + return StaticSiteBuildARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteBuildCollectionIterator type. +func NewStaticSiteBuildCollectionIterator(page StaticSiteBuildCollectionPage) StaticSiteBuildCollectionIterator { + return StaticSiteBuildCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssbc StaticSiteBuildCollection) IsEmpty() bool { + return ssbc.Value == nil || len(*ssbc.Value) == 0 +} + +// staticSiteBuildCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssbc StaticSiteBuildCollection) staticSiteBuildCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ssbc.NextLink == nil || len(to.String(ssbc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssbc.NextLink))) +} + +// StaticSiteBuildCollectionPage contains a page of StaticSiteBuildARMResource values. +type StaticSiteBuildCollectionPage struct { + fn func(context.Context, StaticSiteBuildCollection) (StaticSiteBuildCollection, error) + ssbc StaticSiteBuildCollection +} + +// 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 *StaticSiteBuildCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteBuildCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssbc) + if err != nil { + return err + } + page.ssbc = next + 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 *StaticSiteBuildCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteBuildCollectionPage) NotDone() bool { + return !page.ssbc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteBuildCollectionPage) Response() StaticSiteBuildCollection { + return page.ssbc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteBuildCollectionPage) Values() []StaticSiteBuildARMResource { + if page.ssbc.IsEmpty() { + return nil + } + return *page.ssbc.Value +} + +// Creates a new instance of the StaticSiteBuildCollectionPage type. +func NewStaticSiteBuildCollectionPage(getNextPage func(context.Context, StaticSiteBuildCollection) (StaticSiteBuildCollection, error)) StaticSiteBuildCollectionPage { + return StaticSiteBuildCollectionPage{fn: getNextPage} +} + +// StaticSiteBuildProperties build properties for the static site. +type StaticSiteBuildProperties struct { + // AppLocation - The path to the app code within the repository. + AppLocation *string `json:"appLocation,omitempty"` + // APILocation - The path to the api code within the repository. + APILocation *string `json:"apiLocation,omitempty"` + // AppArtifactLocation - The path of the app artifacts after building. + AppArtifactLocation *string `json:"appArtifactLocation,omitempty"` +} + +// StaticSiteCollection collection of static sites. +type StaticSiteCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticSiteCollectionIterator provides access to a complete listing of StaticSiteARMResource values. +type StaticSiteCollectionIterator struct { + i int + page StaticSiteCollectionPage +} + +// 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 *StaticSiteCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCollectionIterator.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 *StaticSiteCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteCollectionIterator) 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 StaticSiteCollectionIterator) Response() StaticSiteCollection { + 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 StaticSiteCollectionIterator) Value() StaticSiteARMResource { + if !iter.page.NotDone() { + return StaticSiteARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteCollectionIterator type. +func NewStaticSiteCollectionIterator(page StaticSiteCollectionPage) StaticSiteCollectionIterator { + return StaticSiteCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssc StaticSiteCollection) IsEmpty() bool { + return ssc.Value == nil || len(*ssc.Value) == 0 +} + +// staticSiteCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssc StaticSiteCollection) staticSiteCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ssc.NextLink == nil || len(to.String(ssc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssc.NextLink))) +} + +// StaticSiteCollectionPage contains a page of StaticSiteARMResource values. +type StaticSiteCollectionPage struct { + fn func(context.Context, StaticSiteCollection) (StaticSiteCollection, error) + ssc StaticSiteCollection +} + +// 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 *StaticSiteCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssc) + if err != nil { + return err + } + page.ssc = next + 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 *StaticSiteCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteCollectionPage) NotDone() bool { + return !page.ssc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteCollectionPage) Response() StaticSiteCollection { + return page.ssc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteCollectionPage) Values() []StaticSiteARMResource { + if page.ssc.IsEmpty() { + return nil + } + return *page.ssc.Value +} + +// Creates a new instance of the StaticSiteCollectionPage type. +func NewStaticSiteCollectionPage(getNextPage func(context.Context, StaticSiteCollection) (StaticSiteCollection, error)) StaticSiteCollectionPage { + return StaticSiteCollectionPage{fn: getNextPage} +} + +// StaticSiteCustomDomainOverviewARMResource static Site Custom Domain Overview ARM resource. +type StaticSiteCustomDomainOverviewARMResource struct { + autorest.Response `json:"-"` + // StaticSiteCustomDomainOverviewARMResourceProperties - StaticSiteCustomDomainOverviewARMResource resource specific properties + *StaticSiteCustomDomainOverviewARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCustomDomainOverviewARMResource. +func (sscdoar StaticSiteCustomDomainOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties != nil { + objectMap["properties"] = sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties + } + if sscdoar.Kind != nil { + objectMap["kind"] = sscdoar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteCustomDomainOverviewARMResource struct. +func (sscdoar *StaticSiteCustomDomainOverviewARMResource) UnmarshalJSON(body []byte) error { + 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 staticSiteCustomDomainOverviewARMResourceProperties StaticSiteCustomDomainOverviewARMResourceProperties + err = json.Unmarshal(*v, &staticSiteCustomDomainOverviewARMResourceProperties) + if err != nil { + return err + } + sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties = &staticSiteCustomDomainOverviewARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdoar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdoar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sscdoar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdoar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteCustomDomainOverviewARMResourceProperties staticSiteCustomDomainOverviewARMResource resource +// specific properties +type StaticSiteCustomDomainOverviewARMResourceProperties struct { + // DomainName - READ-ONLY; The domain name for the static site custom domain. + DomainName *string `json:"domainName,omitempty"` + // CreatedOn - READ-ONLY; The date and time on which the custom domain was created for the static site. + CreatedOn *date.Time `json:"createdOn,omitempty"` +} + +// StaticSiteCustomDomainOverviewCollection collection of static site custom domains. +type StaticSiteCustomDomainOverviewCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteCustomDomainOverviewARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticSiteCustomDomainOverviewCollectionIterator provides access to a complete listing of +// StaticSiteCustomDomainOverviewARMResource values. +type StaticSiteCustomDomainOverviewCollectionIterator struct { + i int + page StaticSiteCustomDomainOverviewCollectionPage +} + +// 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 *StaticSiteCustomDomainOverviewCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCustomDomainOverviewCollectionIterator.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 *StaticSiteCustomDomainOverviewCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteCustomDomainOverviewCollectionIterator) 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 StaticSiteCustomDomainOverviewCollectionIterator) Response() StaticSiteCustomDomainOverviewCollection { + 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 StaticSiteCustomDomainOverviewCollectionIterator) Value() StaticSiteCustomDomainOverviewARMResource { + if !iter.page.NotDone() { + return StaticSiteCustomDomainOverviewARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteCustomDomainOverviewCollectionIterator type. +func NewStaticSiteCustomDomainOverviewCollectionIterator(page StaticSiteCustomDomainOverviewCollectionPage) StaticSiteCustomDomainOverviewCollectionIterator { + return StaticSiteCustomDomainOverviewCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdoc StaticSiteCustomDomainOverviewCollection) IsEmpty() bool { + return sscdoc.Value == nil || len(*sscdoc.Value) == 0 +} + +// staticSiteCustomDomainOverviewCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdoc StaticSiteCustomDomainOverviewCollection) staticSiteCustomDomainOverviewCollectionPreparer(ctx context.Context) (*http.Request, error) { + if sscdoc.NextLink == nil || len(to.String(sscdoc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdoc.NextLink))) +} + +// StaticSiteCustomDomainOverviewCollectionPage contains a page of +// StaticSiteCustomDomainOverviewARMResource values. +type StaticSiteCustomDomainOverviewCollectionPage struct { + fn func(context.Context, StaticSiteCustomDomainOverviewCollection) (StaticSiteCustomDomainOverviewCollection, error) + sscdoc StaticSiteCustomDomainOverviewCollection +} + +// 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 *StaticSiteCustomDomainOverviewCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCustomDomainOverviewCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscdoc) + if err != nil { + return err + } + page.sscdoc = next + 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 *StaticSiteCustomDomainOverviewCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteCustomDomainOverviewCollectionPage) NotDone() bool { + return !page.sscdoc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteCustomDomainOverviewCollectionPage) Response() StaticSiteCustomDomainOverviewCollection { + return page.sscdoc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteCustomDomainOverviewCollectionPage) Values() []StaticSiteCustomDomainOverviewARMResource { + if page.sscdoc.IsEmpty() { + return nil + } + return *page.sscdoc.Value +} + +// Creates a new instance of the StaticSiteCustomDomainOverviewCollectionPage type. +func NewStaticSiteCustomDomainOverviewCollectionPage(getNextPage func(context.Context, StaticSiteCustomDomainOverviewCollection) (StaticSiteCustomDomainOverviewCollection, error)) StaticSiteCustomDomainOverviewCollectionPage { + return StaticSiteCustomDomainOverviewCollectionPage{fn: getNextPage} +} + +// StaticSiteFunctionOverviewARMResource static Site Function Overview ARM resource. +type StaticSiteFunctionOverviewARMResource struct { + // StaticSiteFunctionOverviewARMResourceProperties - StaticSiteFunctionOverviewARMResource resource specific properties + *StaticSiteFunctionOverviewARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteFunctionOverviewARMResource. +func (ssfoar StaticSiteFunctionOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssfoar.StaticSiteFunctionOverviewARMResourceProperties != nil { + objectMap["properties"] = ssfoar.StaticSiteFunctionOverviewARMResourceProperties + } + if ssfoar.Kind != nil { + objectMap["kind"] = ssfoar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteFunctionOverviewARMResource struct. +func (ssfoar *StaticSiteFunctionOverviewARMResource) UnmarshalJSON(body []byte) error { + 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 staticSiteFunctionOverviewARMResourceProperties StaticSiteFunctionOverviewARMResourceProperties + err = json.Unmarshal(*v, &staticSiteFunctionOverviewARMResourceProperties) + if err != nil { + return err + } + ssfoar.StaticSiteFunctionOverviewARMResourceProperties = &staticSiteFunctionOverviewARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssfoar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssfoar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssfoar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssfoar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteFunctionOverviewARMResourceProperties staticSiteFunctionOverviewARMResource resource specific +// properties +type StaticSiteFunctionOverviewARMResourceProperties struct { + // FunctionName - READ-ONLY; The name for the function + FunctionName *string `json:"functionName,omitempty"` + // TriggerType - READ-ONLY; The trigger type of the function. Possible values include: 'TriggerTypesHTTPTrigger', 'TriggerTypesUnknown' + TriggerType TriggerTypes `json:"triggerType,omitempty"` +} + +// StaticSiteFunctionOverviewCollection collection of static site functions. +type StaticSiteFunctionOverviewCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteFunctionOverviewARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticSiteFunctionOverviewCollectionIterator provides access to a complete listing of +// StaticSiteFunctionOverviewARMResource values. +type StaticSiteFunctionOverviewCollectionIterator struct { + i int + page StaticSiteFunctionOverviewCollectionPage +} + +// 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 *StaticSiteFunctionOverviewCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteFunctionOverviewCollectionIterator.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 *StaticSiteFunctionOverviewCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteFunctionOverviewCollectionIterator) 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 StaticSiteFunctionOverviewCollectionIterator) Response() StaticSiteFunctionOverviewCollection { + 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 StaticSiteFunctionOverviewCollectionIterator) Value() StaticSiteFunctionOverviewARMResource { + if !iter.page.NotDone() { + return StaticSiteFunctionOverviewARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteFunctionOverviewCollectionIterator type. +func NewStaticSiteFunctionOverviewCollectionIterator(page StaticSiteFunctionOverviewCollectionPage) StaticSiteFunctionOverviewCollectionIterator { + return StaticSiteFunctionOverviewCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssfoc StaticSiteFunctionOverviewCollection) IsEmpty() bool { + return ssfoc.Value == nil || len(*ssfoc.Value) == 0 +} + +// staticSiteFunctionOverviewCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssfoc StaticSiteFunctionOverviewCollection) staticSiteFunctionOverviewCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ssfoc.NextLink == nil || len(to.String(ssfoc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssfoc.NextLink))) +} + +// StaticSiteFunctionOverviewCollectionPage contains a page of StaticSiteFunctionOverviewARMResource +// values. +type StaticSiteFunctionOverviewCollectionPage struct { + fn func(context.Context, StaticSiteFunctionOverviewCollection) (StaticSiteFunctionOverviewCollection, error) + ssfoc StaticSiteFunctionOverviewCollection +} + +// 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 *StaticSiteFunctionOverviewCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteFunctionOverviewCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssfoc) + if err != nil { + return err + } + page.ssfoc = next + 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 *StaticSiteFunctionOverviewCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteFunctionOverviewCollectionPage) NotDone() bool { + return !page.ssfoc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteFunctionOverviewCollectionPage) Response() StaticSiteFunctionOverviewCollection { + return page.ssfoc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteFunctionOverviewCollectionPage) Values() []StaticSiteFunctionOverviewARMResource { + if page.ssfoc.IsEmpty() { + return nil + } + return *page.ssfoc.Value +} + +// Creates a new instance of the StaticSiteFunctionOverviewCollectionPage type. +func NewStaticSiteFunctionOverviewCollectionPage(getNextPage func(context.Context, StaticSiteFunctionOverviewCollection) (StaticSiteFunctionOverviewCollection, error)) StaticSiteFunctionOverviewCollectionPage { + return StaticSiteFunctionOverviewCollectionPage{fn: getNextPage} +} + +// StaticSitePatchResource ARM resource for a static site when patching +type StaticSitePatchResource struct { + // StaticSite - Core resource properties + *StaticSite `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSitePatchResource. +func (sspr StaticSitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspr.StaticSite != nil { + objectMap["properties"] = sspr.StaticSite + } + if sspr.Kind != nil { + objectMap["kind"] = sspr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSitePatchResource struct. +func (sspr *StaticSitePatchResource) UnmarshalJSON(body []byte) error { + 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 staticSite StaticSite + err = json.Unmarshal(*v, &staticSite) + if err != nil { + return err + } + sspr.StaticSite = &staticSite + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sspr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteResetPropertiesARMResource static Site Reset Properties ARM resource. +type StaticSiteResetPropertiesARMResource struct { + // StaticSiteResetPropertiesARMResourceProperties - StaticSiteResetPropertiesARMResource resource specific properties + *StaticSiteResetPropertiesARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteResetPropertiesARMResource. +func (ssrpar StaticSiteResetPropertiesARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssrpar.StaticSiteResetPropertiesARMResourceProperties != nil { + objectMap["properties"] = ssrpar.StaticSiteResetPropertiesARMResourceProperties + } + if ssrpar.Kind != nil { + objectMap["kind"] = ssrpar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteResetPropertiesARMResource struct. +func (ssrpar *StaticSiteResetPropertiesARMResource) UnmarshalJSON(body []byte) error { + 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 staticSiteResetPropertiesARMResourceProperties StaticSiteResetPropertiesARMResourceProperties + err = json.Unmarshal(*v, &staticSiteResetPropertiesARMResourceProperties) + if err != nil { + return err + } + ssrpar.StaticSiteResetPropertiesARMResourceProperties = &staticSiteResetPropertiesARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssrpar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssrpar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssrpar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssrpar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteResetPropertiesARMResourceProperties staticSiteResetPropertiesARMResource resource specific +// properties +type StaticSiteResetPropertiesARMResourceProperties struct { + // RepositoryToken - The token which proves admin privileges to the repository. + RepositoryToken *string `json:"repositoryToken,omitempty"` + // ShouldUpdateRepository - Determines whether the repository should be updated with the new properties. + ShouldUpdateRepository *bool `json:"shouldUpdateRepository,omitempty"` +} + +// StaticSiteUserARMResource static Site User ARM resource. +type StaticSiteUserARMResource struct { + autorest.Response `json:"-"` + // StaticSiteUserARMResourceProperties - StaticSiteUserARMResource resource specific properties + *StaticSiteUserARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserARMResource. +func (ssuar StaticSiteUserARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuar.StaticSiteUserARMResourceProperties != nil { + objectMap["properties"] = ssuar.StaticSiteUserARMResourceProperties + } + if ssuar.Kind != nil { + objectMap["kind"] = ssuar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserARMResource struct. +func (ssuar *StaticSiteUserARMResource) UnmarshalJSON(body []byte) error { + 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 staticSiteUserARMResourceProperties StaticSiteUserARMResourceProperties + err = json.Unmarshal(*v, &staticSiteUserARMResourceProperties) + if err != nil { + return err + } + ssuar.StaticSiteUserARMResourceProperties = &staticSiteUserARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserARMResourceProperties staticSiteUserARMResource resource specific properties +type StaticSiteUserARMResourceProperties struct { + // Provider - READ-ONLY; The identity provider for the static site user. + Provider *string `json:"provider,omitempty"` + // UserID - READ-ONLY; The user id for the static site user. + UserID *string `json:"userId,omitempty"` + // DisplayName - READ-ONLY; The display name for the static site user. + DisplayName *string `json:"displayName,omitempty"` + // Roles - The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` +} + +// StaticSiteUserCollection collection of static site custom users. +type StaticSiteUserCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteUserARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticSiteUserCollectionIterator provides access to a complete listing of StaticSiteUserARMResource +// values. +type StaticSiteUserCollectionIterator struct { + i int + page StaticSiteUserCollectionPage +} + +// 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 *StaticSiteUserCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserCollectionIterator.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 *StaticSiteUserCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteUserCollectionIterator) 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 StaticSiteUserCollectionIterator) Response() StaticSiteUserCollection { + 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 StaticSiteUserCollectionIterator) Value() StaticSiteUserARMResource { + if !iter.page.NotDone() { + return StaticSiteUserARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteUserCollectionIterator type. +func NewStaticSiteUserCollectionIterator(page StaticSiteUserCollectionPage) StaticSiteUserCollectionIterator { + return StaticSiteUserCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssuc StaticSiteUserCollection) IsEmpty() bool { + return ssuc.Value == nil || len(*ssuc.Value) == 0 +} + +// staticSiteUserCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssuc StaticSiteUserCollection) staticSiteUserCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ssuc.NextLink == nil || len(to.String(ssuc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssuc.NextLink))) +} + +// StaticSiteUserCollectionPage contains a page of StaticSiteUserARMResource values. +type StaticSiteUserCollectionPage struct { + fn func(context.Context, StaticSiteUserCollection) (StaticSiteUserCollection, error) + ssuc StaticSiteUserCollection +} + +// 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 *StaticSiteUserCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssuc) + if err != nil { + return err + } + page.ssuc = next + 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 *StaticSiteUserCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteUserCollectionPage) NotDone() bool { + return !page.ssuc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteUserCollectionPage) Response() StaticSiteUserCollection { + return page.ssuc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteUserCollectionPage) Values() []StaticSiteUserARMResource { + if page.ssuc.IsEmpty() { + return nil + } + return *page.ssuc.Value +} + +// Creates a new instance of the StaticSiteUserCollectionPage type. +func NewStaticSiteUserCollectionPage(getNextPage func(context.Context, StaticSiteUserCollection) (StaticSiteUserCollection, error)) StaticSiteUserCollectionPage { + return StaticSiteUserCollectionPage{fn: getNextPage} +} + +// StaticSiteUserInvitationRequestResource static sites user roles invitation resource. +type StaticSiteUserInvitationRequestResource struct { + // StaticSiteUserInvitationRequestResourceProperties - StaticSiteUserInvitationRequestResource resource specific properties + *StaticSiteUserInvitationRequestResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserInvitationRequestResource. +func (ssuirr StaticSiteUserInvitationRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuirr.StaticSiteUserInvitationRequestResourceProperties != nil { + objectMap["properties"] = ssuirr.StaticSiteUserInvitationRequestResourceProperties + } + if ssuirr.Kind != nil { + objectMap["kind"] = ssuirr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserInvitationRequestResource struct. +func (ssuirr *StaticSiteUserInvitationRequestResource) UnmarshalJSON(body []byte) error { + 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 staticSiteUserInvitationRequestResourceProperties StaticSiteUserInvitationRequestResourceProperties + err = json.Unmarshal(*v, &staticSiteUserInvitationRequestResourceProperties) + if err != nil { + return err + } + ssuirr.StaticSiteUserInvitationRequestResourceProperties = &staticSiteUserInvitationRequestResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuirr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuirr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuirr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuirr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserInvitationRequestResourceProperties staticSiteUserInvitationRequestResource resource +// specific properties +type StaticSiteUserInvitationRequestResourceProperties struct { + // Domain - The domain name for the static site custom domain. + Domain *string `json:"domain,omitempty"` + // Provider - The identity provider for the static site user. + Provider *string `json:"provider,omitempty"` + // UserDetails - The user id for the static site user. + UserDetails *string `json:"userDetails,omitempty"` + // Roles - The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` + // NumHoursToExpiration - The number of hours the sas token stays valid + NumHoursToExpiration *int32 `json:"numHoursToExpiration,omitempty"` +} + +// StaticSiteUserInvitationResponseResource static sites user roles invitation link resource. +type StaticSiteUserInvitationResponseResource struct { + autorest.Response `json:"-"` + // StaticSiteUserInvitationResponseResourceProperties - StaticSiteUserInvitationResponseResource resource specific properties + *StaticSiteUserInvitationResponseResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserInvitationResponseResource. +func (ssuirr StaticSiteUserInvitationResponseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuirr.StaticSiteUserInvitationResponseResourceProperties != nil { + objectMap["properties"] = ssuirr.StaticSiteUserInvitationResponseResourceProperties + } + if ssuirr.Kind != nil { + objectMap["kind"] = ssuirr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserInvitationResponseResource struct. +func (ssuirr *StaticSiteUserInvitationResponseResource) UnmarshalJSON(body []byte) error { + 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 staticSiteUserInvitationResponseResourceProperties StaticSiteUserInvitationResponseResourceProperties + err = json.Unmarshal(*v, &staticSiteUserInvitationResponseResourceProperties) + if err != nil { + return err + } + ssuirr.StaticSiteUserInvitationResponseResourceProperties = &staticSiteUserInvitationResponseResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuirr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuirr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuirr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuirr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserInvitationResponseResourceProperties staticSiteUserInvitationResponseResource resource +// specific properties +type StaticSiteUserInvitationResponseResourceProperties struct { + // ExpiresOn - READ-ONLY; The expiration time of the invitation + ExpiresOn *date.Time `json:"expiresOn,omitempty"` + // InvitationURL - READ-ONLY; The url for the invitation link + InvitationURL *string `json:"invitationUrl,omitempty"` +} + // StatusCodesBasedTrigger trigger based on status code. type StatusCodesBasedTrigger struct { // Status - HTTP status code. diff --git a/services/web/mgmt/2019-08-01/web/staticsites.go b/services/web/mgmt/2019-08-01/web/staticsites.go new file mode 100644 index 000000000000..f39d11f7a6c9 --- /dev/null +++ b/services/web/mgmt/2019-08-01/web/staticsites.go @@ -0,0 +1,2520 @@ +package web + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// StaticSitesClient is the webSite Management Client +type StaticSitesClient struct { + BaseClient +} + +// NewStaticSitesClient creates an instance of the StaticSitesClient client. +func NewStaticSitesClient(subscriptionID string) StaticSitesClient { + return NewStaticSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStaticSitesClientWithBaseURI creates an instance of the StaticSitesClient 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 NewStaticSitesClientWithBaseURI(baseURI string, subscriptionID string) StaticSitesClient { + return StaticSitesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdateStaticSite description for Creates a new static site in an existing resource group, or updates an +// existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to create or update. +// staticSiteEnvelope - a JSON representation of the staticsite properties. See example. +func (client StaticSitesClient) CreateOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource) (result StaticSiteARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSite", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSitePreparer(ctx, resourceGroupName, name, staticSiteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSite", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSite", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateStaticSitePreparer prepares the CreateOrUpdateStaticSite request. +func (client StaticSitesClient) CreateOrUpdateStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithJSON(staticSiteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteSender sends the CreateOrUpdateStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteResponder handles the response to the CreateOrUpdateStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettings description for Creates or updates the function app settings of a +// static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// prID - the stage site identifier. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, prID string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteBuildFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer(ctx, resourceGroupName, name, prID, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer prepares the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, prID string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "prId": autorest.Encode("path", prID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender sends the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteCustomDomain description for Creates a new static site custom domain in an existing resource +// group and static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to create. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result StaticSiteCustomDomainOverviewARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteCustomDomainPreparer(ctx, resourceGroupName, name, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteCustomDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateStaticSiteCustomDomainPreparer prepares the CreateOrUpdateStaticSiteCustomDomain request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainPreparer(ctx context.Context, resourceGroupName string, name string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteCustomDomainSender sends the CreateOrUpdateStaticSiteCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteCustomDomainResponder handles the response to the CreateOrUpdateStaticSiteCustomDomain request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainResponder(resp *http.Response) (result StaticSiteCustomDomainOverviewARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteFunctionAppSettings description for Creates or updates the function app settings of a static +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteFunctionAppSettingsPreparer(ctx, resourceGroupName, name, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsPreparer prepares the CreateOrUpdateStaticSiteFunctionAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsSender sends the CreateOrUpdateStaticSiteFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUserRolesInvitationLink description for Creates an invitation link for a user with the role +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource) (result StaticSiteUserInvitationResponseResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateUserRolesInvitationLink") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateUserRolesInvitationLink", err.Error()) + } + + req, err := client.CreateUserRolesInvitationLinkPreparer(ctx, resourceGroupName, name, staticSiteUserRolesInvitationEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", nil, "Failure preparing request") + return + } + + resp, err := client.CreateUserRolesInvitationLinkSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", resp, "Failure sending request") + return + } + + result, err = client.CreateUserRolesInvitationLinkResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", resp, "Failure responding to request") + } + + return +} + +// CreateUserRolesInvitationLinkPreparer prepares the CreateUserRolesInvitationLink request. +func (client StaticSitesClient) CreateUserRolesInvitationLinkPreparer(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation", pathParameters), + autorest.WithJSON(staticSiteUserRolesInvitationEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUserRolesInvitationLinkSender sends the CreateUserRolesInvitationLink request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateUserRolesInvitationLinkSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateUserRolesInvitationLinkResponder handles the response to the CreateUserRolesInvitationLink request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateUserRolesInvitationLinkResponder(resp *http.Response) (result StaticSiteUserInvitationResponseResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteStaticSite description for Deletes a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to delete. +func (client StaticSitesClient) DeleteStaticSite(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSite") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSite", err.Error()) + } + + req, err := client.DeleteStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStaticSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSite", resp, "Failure sending request") + return + } + + result, err = client.DeleteStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSite", resp, "Failure responding to request") + } + + return +} + +// DeleteStaticSitePreparer prepares the DeleteStaticSite request. +func (client StaticSitesClient) DeleteStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteSender sends the DeleteStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteStaticSiteResponder handles the response to the DeleteStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteBuild description for Deletes a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// prID - the stage site identifier. +func (client StaticSitesClient) DeleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, prID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteBuild") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteBuild", err.Error()) + } + + req, err := client.DeleteStaticSiteBuildPreparer(ctx, resourceGroupName, name, prID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStaticSiteBuildSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteBuild", resp, "Failure sending request") + return + } + + result, err = client.DeleteStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteBuild", resp, "Failure responding to request") + } + + return +} + +// DeleteStaticSiteBuildPreparer prepares the DeleteStaticSiteBuild request. +func (client StaticSitesClient) DeleteStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, prID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "prId": autorest.Encode("path", prID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteBuildSender sends the DeleteStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteStaticSiteBuildResponder handles the response to the DeleteStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteBuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteCustomDomain description for Deletes a custom domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to delete. +func (client StaticSitesClient) DeleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteCustomDomain") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteCustomDomain", err.Error()) + } + + req, err := client.DeleteStaticSiteCustomDomainPreparer(ctx, resourceGroupName, name, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStaticSiteCustomDomainSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.DeleteStaticSiteCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteCustomDomain", resp, "Failure responding to request") + } + + return +} + +// DeleteStaticSiteCustomDomainPreparer prepares the DeleteStaticSiteCustomDomain request. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainPreparer(ctx context.Context, resourceGroupName string, name string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteCustomDomainSender sends the DeleteStaticSiteCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteStaticSiteCustomDomainResponder handles the response to the DeleteStaticSiteCustomDomain request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteUser description for Deletes the user entry from the static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the staticsite. +// authprovider - the auth provider for this user. +// userid - the user id of the user. +func (client StaticSitesClient) DeleteStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteUser") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteUser", err.Error()) + } + + req, err := client.DeleteStaticSiteUserPreparer(ctx, resourceGroupName, name, authprovider, userid) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStaticSiteUserSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", resp, "Failure sending request") + return + } + + result, err = client.DeleteStaticSiteUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", resp, "Failure responding to request") + } + + return +} + +// DeleteStaticSiteUserPreparer prepares the DeleteStaticSiteUser request. +func (client StaticSitesClient) DeleteStaticSiteUserPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userid": autorest.Encode("path", userid), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteUserSender sends the DeleteStaticSiteUser request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteStaticSiteUserResponder handles the response to the DeleteStaticSiteUser request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteUserResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachStaticSite description for Detaches a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to detach. +func (client StaticSitesClient) DetachStaticSite(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DetachStaticSite") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DetachStaticSite", err.Error()) + } + + req, err := client.DetachStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.DetachStaticSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachStaticSite", resp, "Failure sending request") + return + } + + result, err = client.DetachStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachStaticSite", resp, "Failure responding to request") + } + + return +} + +// DetachStaticSitePreparer prepares the DetachStaticSite request. +func (client StaticSitesClient) DetachStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachStaticSiteSender sends the DetachStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DetachStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DetachStaticSiteResponder handles the response to the DetachStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DetachStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetStaticSite description for Gets the details of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetStaticSite(ctx context.Context, resourceGroupName string, name string) (result StaticSiteARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSite", err.Error()) + } + + req, err := client.GetStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", resp, "Failure sending request") + return + } + + result, err = client.GetStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", resp, "Failure responding to request") + } + + return +} + +// GetStaticSitePreparer prepares the GetStaticSite request. +func (client StaticSitesClient) GetStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteSender sends the GetStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteResponder handles the response to the GetStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSiteBuild description for Gets the details of a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// prID - the stage site identifier. +func (client StaticSitesClient) GetStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, prID string) (result StaticSiteBuildARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSiteBuild", err.Error()) + } + + req, err := client.GetStaticSiteBuildPreparer(ctx, resourceGroupName, name, prID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteBuildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", resp, "Failure sending request") + return + } + + result, err = client.GetStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", resp, "Failure responding to request") + } + + return +} + +// GetStaticSiteBuildPreparer prepares the GetStaticSiteBuild request. +func (client StaticSitesClient) GetStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, prID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "prId": autorest.Encode("path", prID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteBuildSender sends the GetStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteBuildResponder handles the response to the GetStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteBuildResponder(resp *http.Response) (result StaticSiteBuildARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSiteBuilds description for Gets all static site builds for a particular static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetStaticSiteBuilds(ctx context.Context, resourceGroupName string, name string) (result StaticSiteBuildCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuilds") + defer func() { + sc := -1 + if result.ssbc.Response.Response != nil { + sc = result.ssbc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSiteBuilds", err.Error()) + } + + result.fn = client.getStaticSiteBuildsNextResults + req, err := client.GetStaticSiteBuildsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteBuildsSender(req) + if err != nil { + result.ssbc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", resp, "Failure sending request") + return + } + + result.ssbc, err = client.GetStaticSiteBuildsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", resp, "Failure responding to request") + } + + return +} + +// GetStaticSiteBuildsPreparer prepares the GetStaticSiteBuilds request. +func (client StaticSitesClient) GetStaticSiteBuildsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteBuildsSender sends the GetStaticSiteBuilds request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteBuildsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteBuildsResponder handles the response to the GetStaticSiteBuilds request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteBuildsResponder(resp *http.Response) (result StaticSiteBuildCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getStaticSiteBuildsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getStaticSiteBuildsNextResults(ctx context.Context, lastResults StaticSiteBuildCollection) (result StaticSiteBuildCollection, err error) { + req, err := lastResults.staticSiteBuildCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetStaticSiteBuildsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetStaticSiteBuildsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetStaticSiteBuildsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetStaticSiteBuildsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteBuildCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuilds") + 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.GetStaticSiteBuilds(ctx, resourceGroupName, name) + return +} + +// GetStaticSitesByResourceGroup description for Gets all static sites in the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client StaticSitesClient) GetStaticSitesByResourceGroup(ctx context.Context, resourceGroupName string) (result StaticSiteCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSitesByResourceGroup") + defer func() { + sc := -1 + if result.ssc.Response.Response != nil { + sc = result.ssc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSitesByResourceGroup", err.Error()) + } + + result.fn = client.getStaticSitesByResourceGroupNextResults + req, err := client.GetStaticSitesByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSitesByResourceGroupSender(req) + if err != nil { + result.ssc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", resp, "Failure sending request") + return + } + + result.ssc, err = client.GetStaticSitesByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// GetStaticSitesByResourceGroupPreparer prepares the GetStaticSitesByResourceGroup request. +func (client StaticSitesClient) GetStaticSitesByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSitesByResourceGroupSender sends the GetStaticSitesByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSitesByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSitesByResourceGroupResponder handles the response to the GetStaticSitesByResourceGroup request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSitesByResourceGroupResponder(resp *http.Response) (result StaticSiteCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getStaticSitesByResourceGroupNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getStaticSitesByResourceGroupNextResults(ctx context.Context, lastResults StaticSiteCollection) (result StaticSiteCollection, err error) { + req, err := lastResults.staticSiteCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetStaticSitesByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.GetStaticSitesByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetStaticSitesByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetStaticSitesByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result StaticSiteCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSitesByResourceGroup") + 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.GetStaticSitesByResourceGroup(ctx, resourceGroupName) + return +} + +// List description for Get all Static Sites for a subscription. +func (client StaticSitesClient) List(ctx context.Context) (result StaticSiteCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.List") + defer func() { + sc := -1 + if result.ssc.Response.Response != nil { + sc = result.ssc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", resp, "Failure sending request") + return + } + + result.ssc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StaticSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites", 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 StaticSitesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListResponder(resp *http.Response) (result StaticSiteCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listNextResults(ctx context.Context, lastResults StaticSiteCollection) (result StaticSiteCollection, err error) { + req, err := lastResults.staticSiteCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "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, "web.StaticSitesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListComplete(ctx context.Context) (result StaticSiteCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.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 +} + +// ListStaticSiteBuildFunctionAppSettings description for Gets the application settings of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// prID - the stage site identifier. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, prID string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteBuildFunctionAppSettingsPreparer(ctx, resourceGroupName, name, prID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteBuildFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteBuildFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteBuildFunctionAppSettingsPreparer prepares the ListStaticSiteBuildFunctionAppSettings request. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, prID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "prId": autorest.Encode("path", prID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteBuildFunctionAppSettingsSender sends the ListStaticSiteBuildFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteBuildFunctionAppSettingsResponder handles the response to the ListStaticSiteBuildFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteBuildFunctions description for Gets the functions of a particular static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// prID - the stage site identifier. +func (client StaticSitesClient) ListStaticSiteBuildFunctions(ctx context.Context, resourceGroupName string, name string, prID string) (result StaticSiteFunctionOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctions") + defer func() { + sc := -1 + if result.ssfoc.Response.Response != nil { + sc = result.ssfoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteBuildFunctions", err.Error()) + } + + result.fn = client.listStaticSiteBuildFunctionsNextResults + req, err := client.ListStaticSiteBuildFunctionsPreparer(ctx, resourceGroupName, name, prID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteBuildFunctionsSender(req) + if err != nil { + result.ssfoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", resp, "Failure sending request") + return + } + + result.ssfoc, err = client.ListStaticSiteBuildFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteBuildFunctionsPreparer prepares the ListStaticSiteBuildFunctions request. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsPreparer(ctx context.Context, resourceGroupName string, name string, prID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "prId": autorest.Encode("path", prID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteBuildFunctionsSender sends the ListStaticSiteBuildFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteBuildFunctionsResponder handles the response to the ListStaticSiteBuildFunctions request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsResponder(resp *http.Response) (result StaticSiteFunctionOverviewCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteBuildFunctionsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteBuildFunctionsNextResults(ctx context.Context, lastResults StaticSiteFunctionOverviewCollection) (result StaticSiteFunctionOverviewCollection, err error) { + req, err := lastResults.staticSiteFunctionOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteBuildFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteBuildFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteBuildFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsComplete(ctx context.Context, resourceGroupName string, name string, prID string) (result StaticSiteFunctionOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctions") + 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.ListStaticSiteBuildFunctions(ctx, resourceGroupName, name, prID) + return +} + +// ListStaticSiteCustomDomains description for Gets all static site custom domains for a particular static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site resource to search in. +func (client StaticSitesClient) ListStaticSiteCustomDomains(ctx context.Context, resourceGroupName string, name string) (result StaticSiteCustomDomainOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteCustomDomains") + defer func() { + sc := -1 + if result.sscdoc.Response.Response != nil { + sc = result.sscdoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteCustomDomains", err.Error()) + } + + result.fn = client.listStaticSiteCustomDomainsNextResults + req, err := client.ListStaticSiteCustomDomainsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteCustomDomainsSender(req) + if err != nil { + result.sscdoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", resp, "Failure sending request") + return + } + + result.sscdoc, err = client.ListStaticSiteCustomDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteCustomDomainsPreparer prepares the ListStaticSiteCustomDomains request. +func (client StaticSitesClient) ListStaticSiteCustomDomainsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteCustomDomainsSender sends the ListStaticSiteCustomDomains request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteCustomDomainsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteCustomDomainsResponder handles the response to the ListStaticSiteCustomDomains request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteCustomDomainsResponder(resp *http.Response) (result StaticSiteCustomDomainOverviewCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteCustomDomainsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteCustomDomainsNextResults(ctx context.Context, lastResults StaticSiteCustomDomainOverviewCollection) (result StaticSiteCustomDomainOverviewCollection, err error) { + req, err := lastResults.staticSiteCustomDomainOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteCustomDomainsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteCustomDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteCustomDomainsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteCustomDomainsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteCustomDomainOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteCustomDomains") + 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.ListStaticSiteCustomDomains(ctx, resourceGroupName, name) + return +} + +// ListStaticSiteFunctionAppSettings description for Gets the application settings of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteFunctionAppSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteFunctionAppSettingsPreparer prepares the ListStaticSiteFunctionAppSettings request. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteFunctionAppSettingsSender sends the ListStaticSiteFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteFunctionAppSettingsResponder handles the response to the ListStaticSiteFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteFunctions description for Gets the functions of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteFunctions(ctx context.Context, resourceGroupName string, name string) (result StaticSiteFunctionOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctions") + defer func() { + sc := -1 + if result.ssfoc.Response.Response != nil { + sc = result.ssfoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteFunctions", err.Error()) + } + + result.fn = client.listStaticSiteFunctionsNextResults + req, err := client.ListStaticSiteFunctionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteFunctionsSender(req) + if err != nil { + result.ssfoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", resp, "Failure sending request") + return + } + + result.ssfoc, err = client.ListStaticSiteFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteFunctionsPreparer prepares the ListStaticSiteFunctions request. +func (client StaticSitesClient) ListStaticSiteFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteFunctionsSender sends the ListStaticSiteFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteFunctionsResponder handles the response to the ListStaticSiteFunctions request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteFunctionsResponder(resp *http.Response) (result StaticSiteFunctionOverviewCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteFunctionsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteFunctionsNextResults(ctx context.Context, lastResults StaticSiteFunctionOverviewCollection) (result StaticSiteFunctionOverviewCollection, err error) { + req, err := lastResults.staticSiteFunctionOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteFunctionOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctions") + 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.ListStaticSiteFunctions(ctx, resourceGroupName, name) + return +} + +// ListStaticSiteSecrets description for Lists the secrets for an existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteSecrets", err.Error()) + } + + req, err := client.ListStaticSiteSecretsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteSecretsPreparer prepares the ListStaticSiteSecrets request. +func (client StaticSitesClient) ListStaticSiteSecretsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteSecretsSender sends the ListStaticSiteSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteSecretsResponder handles the response to the ListStaticSiteSecrets request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteSecretsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteUsers description for Gets the list of users of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// authprovider - the auth provider for the users. +func (client StaticSitesClient) ListStaticSiteUsers(ctx context.Context, resourceGroupName string, name string, authprovider string) (result StaticSiteUserCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteUsers") + defer func() { + sc := -1 + if result.ssuc.Response.Response != nil { + sc = result.ssuc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteUsers", err.Error()) + } + + result.fn = client.listStaticSiteUsersNextResults + req, err := client.ListStaticSiteUsersPreparer(ctx, resourceGroupName, name, authprovider) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteUsersSender(req) + if err != nil { + result.ssuc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", resp, "Failure sending request") + return + } + + result.ssuc, err = client.ListStaticSiteUsersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", resp, "Failure responding to request") + } + + return +} + +// ListStaticSiteUsersPreparer prepares the ListStaticSiteUsers request. +func (client StaticSitesClient) ListStaticSiteUsersPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteUsersSender sends the ListStaticSiteUsers request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteUsersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteUsersResponder handles the response to the ListStaticSiteUsers request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteUsersResponder(resp *http.Response) (result StaticSiteUserCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteUsersNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteUsersNextResults(ctx context.Context, lastResults StaticSiteUserCollection) (result StaticSiteUserCollection, err error) { + req, err := lastResults.staticSiteUserCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteUsersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteUsersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteUsersComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteUsersComplete(ctx context.Context, resourceGroupName string, name string, authprovider string) (result StaticSiteUserCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteUsers") + 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.ListStaticSiteUsers(ctx, resourceGroupName, name, authprovider) + return +} + +// ResetStaticSiteAPIKey description for Resets the api key for an existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ResetStaticSiteAPIKey(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ResetStaticSiteAPIKey") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ResetStaticSiteAPIKey", err.Error()) + } + + req, err := client.ResetStaticSiteAPIKeyPreparer(ctx, resourceGroupName, name, resetPropertiesEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", nil, "Failure preparing request") + return + } + + resp, err := client.ResetStaticSiteAPIKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", resp, "Failure sending request") + return + } + + result, err = client.ResetStaticSiteAPIKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", resp, "Failure responding to request") + } + + return +} + +// ResetStaticSiteAPIKeyPreparer prepares the ResetStaticSiteAPIKey request. +func (client StaticSitesClient) ResetStaticSiteAPIKeyPreparer(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey", pathParameters), + autorest.WithJSON(resetPropertiesEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetStaticSiteAPIKeySender sends the ResetStaticSiteAPIKey request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ResetStaticSiteAPIKeySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetStaticSiteAPIKeyResponder handles the response to the ResetStaticSiteAPIKey request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ResetStaticSiteAPIKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateStaticSite description for Creates a new static site in an existing resource group, or updates an existing +// static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to create or update. +// staticSiteEnvelope - a JSON representation of the staticsite properties. See example. +func (client StaticSitesClient) UpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource) (result StaticSiteARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.UpdateStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "UpdateStaticSite", err.Error()) + } + + req, err := client.UpdateStaticSitePreparer(ctx, resourceGroupName, name, staticSiteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", resp, "Failure sending request") + return + } + + result, err = client.UpdateStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", resp, "Failure responding to request") + } + + return +} + +// UpdateStaticSitePreparer prepares the UpdateStaticSite request. +func (client StaticSitesClient) UpdateStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithJSON(staticSiteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateStaticSiteSender sends the UpdateStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) UpdateStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateStaticSiteResponder handles the response to the UpdateStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) UpdateStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateStaticSiteUser description for Updates a user entry with the listed roles +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// authprovider - the auth provider for this user. +// userid - the user id of the user. +// staticSiteUserEnvelope - a JSON representation of the StaticSiteUser properties. See example. +func (client StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource) (result StaticSiteUserARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.UpdateStaticSiteUser") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "UpdateStaticSiteUser", err.Error()) + } + + req, err := client.UpdateStaticSiteUserPreparer(ctx, resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateStaticSiteUserSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", resp, "Failure sending request") + return + } + + result, err = client.UpdateStaticSiteUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", resp, "Failure responding to request") + } + + return +} + +// UpdateStaticSiteUserPreparer prepares the UpdateStaticSiteUser request. +func (client StaticSitesClient) UpdateStaticSiteUserPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userid": autorest.Encode("path", userid), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}", pathParameters), + autorest.WithJSON(staticSiteUserEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateStaticSiteUserSender sends the UpdateStaticSiteUser request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) UpdateStaticSiteUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateStaticSiteUserResponder handles the response to the UpdateStaticSiteUser request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) UpdateStaticSiteUserResponder(resp *http.Response) (result StaticSiteUserARMResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateCustomDomainCanBeAddedToStaticSite description for Validates a particular custom domain can be added to a +// static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to validate. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", err.Error()) + } + + req, err := client.ValidateCustomDomainCanBeAddedToStaticSitePreparer(ctx, resourceGroupName, name, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateCustomDomainCanBeAddedToStaticSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", resp, "Failure sending request") + return + } + + result, err = client.ValidateCustomDomainCanBeAddedToStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", resp, "Failure responding to request") + } + + return +} + +// ValidateCustomDomainCanBeAddedToStaticSitePreparer prepares the ValidateCustomDomainCanBeAddedToStaticSite request. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateCustomDomainCanBeAddedToStaticSiteSender sends the ValidateCustomDomainCanBeAddedToStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateCustomDomainCanBeAddedToStaticSiteResponder handles the response to the ValidateCustomDomainCanBeAddedToStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2019-08-01/web/version.go b/services/web/mgmt/2019-08-01/web/version.go index 21f486dc5341..1dee06cf7b69 100644 --- a/services/web/mgmt/2019-08-01/web/version.go +++ b/services/web/mgmt/2019-08-01/web/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " web/2019-08-01" + return "Azure-SDK-For-Go/" + Version() + " web/2019-08-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go index b9b7f5b12fe7..3c50f5ee92d7 100644 --- a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go @@ -240,6 +240,7 @@ type AppsClientAPI interface { AnalyzeCustomHostnameSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result web.CustomHostnameAnalysisResult, err error) ApplySlotConfigToProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result autorest.Response, err error) ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result autorest.Response, err error) + ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper web.PrivateLinkConnectionApprovalRequestResource) (result web.AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) Backup(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest) (result web.BackupItem, err error) BackupSlot(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest, slot string) (result web.BackupItem, err error) CopyProductionSlot(ctx context.Context, resourceGroupName string, name string, copySlotEntity web.CsmCopySlotEntity) (result web.AppsCopyProductionSlotFuture, err error) @@ -303,6 +304,7 @@ type AppsClientAPI interface { DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result autorest.Response, err error) DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result autorest.Response, err error) + DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.AppsDeletePrivateEndpointConnectionFuture, err error) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result autorest.Response, err error) @@ -385,6 +387,8 @@ type AppsClientAPI interface { GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result web.PremierAddOn, err error) GetPrivateAccess(ctx context.Context, resourceGroupName string, name string) (result web.PrivateAccess, err error) GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PrivateAccess, err error) + GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.PrivateEndpointConnectionResource, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result web.PrivateLinkResourcesWrapper, err error) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessInfo, err error) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ReadCloser, err error) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ReadCloser, err error) @@ -656,6 +660,45 @@ type AppsClientAPI interface { var _ AppsClientAPI = (*web.AppsClient)(nil) +// StaticSitesClientAPI contains the set of methods on the StaticSitesClient type. +type StaticSitesClientAPI interface { + CreateOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope web.StaticSiteARMResource) (result web.StaticSiteARMResource, err error) + CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, prID string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result web.StaticSiteCustomDomainOverviewARMResource, err error) + CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateUserRolesInvitationLink(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope web.StaticSiteUserInvitationRequestResource) (result web.StaticSiteUserInvitationResponseResource, err error) + DeleteStaticSite(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + DeleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, prID string) (result autorest.Response, err error) + DeleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result autorest.Response, err error) + DeleteStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (result autorest.Response, err error) + DetachStaticSite(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + GetStaticSite(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteARMResource, err error) + GetStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, prID string) (result web.StaticSiteBuildARMResource, err error) + GetStaticSiteBuilds(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteBuildCollectionPage, err error) + GetStaticSiteBuildsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteBuildCollectionIterator, err error) + GetStaticSitesByResourceGroup(ctx context.Context, resourceGroupName string) (result web.StaticSiteCollectionPage, err error) + GetStaticSitesByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.StaticSiteCollectionIterator, err error) + List(ctx context.Context) (result web.StaticSiteCollectionPage, err error) + ListComplete(ctx context.Context) (result web.StaticSiteCollectionIterator, err error) + ListStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, prID string) (result web.StringDictionary, err error) + ListStaticSiteBuildFunctions(ctx context.Context, resourceGroupName string, name string, prID string) (result web.StaticSiteFunctionOverviewCollectionPage, err error) + ListStaticSiteBuildFunctionsComplete(ctx context.Context, resourceGroupName string, name string, prID string) (result web.StaticSiteFunctionOverviewCollectionIterator, err error) + ListStaticSiteCustomDomains(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteCustomDomainOverviewCollectionPage, err error) + ListStaticSiteCustomDomainsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteCustomDomainOverviewCollectionIterator, err error) + ListStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListStaticSiteFunctions(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteFunctionOverviewCollectionPage, err error) + ListStaticSiteFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteFunctionOverviewCollectionIterator, err error) + ListStaticSiteSecrets(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListStaticSiteUsers(ctx context.Context, resourceGroupName string, name string, authprovider string) (result web.StaticSiteUserCollectionPage, err error) + ListStaticSiteUsersComplete(ctx context.Context, resourceGroupName string, name string, authprovider string) (result web.StaticSiteUserCollectionIterator, err error) + ResetStaticSiteAPIKey(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope web.StaticSiteResetPropertiesARMResource) (result autorest.Response, err error) + UpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope web.StaticSitePatchResource) (result web.StaticSiteARMResource, err error) + UpdateStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope web.StaticSiteUserARMResource) (result web.StaticSiteUserARMResource, err error) + ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string) (result autorest.Response, err error) +} + +var _ StaticSitesClientAPI = (*web.StaticSitesClient)(nil) + // AppServiceEnvironmentsClientAPI contains the set of methods on the AppServiceEnvironmentsClient type. type AppServiceEnvironmentsClientAPI interface { ChangeVnet(ctx context.Context, resourceGroupName string, name string, vnetInfo web.VirtualNetworkProfile) (result web.AppServiceEnvironmentsChangeVnetFuture, err error)