diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md index 43207954bf0e..9b806f4340dc 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md @@ -1,5 +1,32 @@ # Release History +## 1.0.0 (2023-09-22) +### Features Added + +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateCreating`, `ProvisioningStateFailed`, `ProvisioningStateSucceeded`, `ProvisioningStateUpdating` +- New enum type `ServiceName` with values `ServiceNameSSH`, `ServiceNameWAC` +- New function `*ClientFactory.NewServiceConfigurationsClient() *ServiceConfigurationsClient` +- New function `*EndpointsClient.ListIngressGatewayCredentials(context.Context, string, string, *EndpointsClientListIngressGatewayCredentialsOptions) (EndpointsClientListIngressGatewayCredentialsResponse, error)` +- New function `NewServiceConfigurationsClient(azcore.TokenCredential, *arm.ClientOptions) (*ServiceConfigurationsClient, error)` +- New function `*ServiceConfigurationsClient.CreateOrupdate(context.Context, string, string, string, ServiceConfigurationResource, *ServiceConfigurationsClientCreateOrupdateOptions) (ServiceConfigurationsClientCreateOrupdateResponse, error)` +- New function `*ServiceConfigurationsClient.Delete(context.Context, string, string, string, *ServiceConfigurationsClientDeleteOptions) (ServiceConfigurationsClientDeleteResponse, error)` +- New function `*ServiceConfigurationsClient.Get(context.Context, string, string, string, *ServiceConfigurationsClientGetOptions) (ServiceConfigurationsClientGetResponse, error)` +- New function `*ServiceConfigurationsClient.NewListByEndpointResourcePager(string, string, *ServiceConfigurationsClientListByEndpointResourceOptions) *runtime.Pager[ServiceConfigurationsClientListByEndpointResourceResponse]` +- New function `*ServiceConfigurationsClient.Update(context.Context, string, string, string, ServiceConfigurationResourcePatch, *ServiceConfigurationsClientUpdateOptions) (ServiceConfigurationsClientUpdateResponse, error)` +- New struct `ListCredentialsRequest` +- New struct `ListIngressGatewayCredentialsRequest` +- New struct `ServiceConfigurationList` +- New struct `ServiceConfigurationProperties` +- New struct `ServiceConfigurationPropertiesPatch` +- New struct `ServiceConfigurationResource` +- New struct `ServiceConfigurationResourcePatch` +- New field `ListCredentialsRequest` in struct `EndpointsClientListCredentialsOptions` +- New field `ServiceName` in struct `ManagedProxyRequest` +- New field `SystemData` in struct `ProxyResource` +- New field `ServiceConfigurationToken` in struct `RelayNamespaceAccessProperties` +- New field `SystemData` in struct `Resource` + + ## 0.6.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/autorest.md b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/autorest.md index 971039a5bcce..547477e47021 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/autorest.md +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.1 - +module-version: 1.0.0 +tag: package-2023-03 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/client_factory.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/client_factory.go index 281ec83fddc0..59a7d7f996de 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/client_factory.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity @@ -36,12 +35,17 @@ func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOpti }, nil } +func (c *ClientFactory) NewEndpointsClient() *EndpointsClient { + subClient, _ := NewEndpointsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewEndpointsClient() *EndpointsClient { - subClient, _ := NewEndpointsClient(c.credential, c.options) +func (c *ClientFactory) NewServiceConfigurationsClient() *ServiceConfigurationsClient { + subClient, _ := NewServiceConfigurationsClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go index 14bfb0e9c423..b5b25ff4e910 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity const ( moduleName = "armhybridconnectivity" - moduleVersion = "v0.6.1" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -67,6 +66,44 @@ func PossibleOriginValues() []Origin { } } +// ProvisioningState - The resource provisioning state. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// ServiceName - Name of the service. +type ServiceName string + +const ( + ServiceNameSSH ServiceName = "SSH" + ServiceNameWAC ServiceName = "WAC" +) + +// PossibleServiceNameValues returns the possible values for the ServiceName const type. +func PossibleServiceNameValues() []ServiceName { + return []ServiceName{ + ServiceNameSSH, + ServiceNameWAC, + } +} + // Type - The type of endpoint. type Type string diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client.go index a0e3ad229ac6..f9d7d5a7d059 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity @@ -43,25 +42,28 @@ func NewEndpointsClient(credential azcore.TokenCredential, options *arm.ClientOp // CreateOrUpdate - Create or update the endpoint to the target resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - endpointResource - Endpoint details // - options - EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate // method. func (client *EndpointsClient) CreateOrUpdate(ctx context.Context, resourceURI string, endpointName string, endpointResource EndpointResource, options *EndpointsClientCreateOrUpdateOptions) (EndpointsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceURI, endpointName, endpointResource, options) if err != nil { return EndpointsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -74,10 +76,13 @@ func (client *EndpointsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpointResource) + if err := runtime.MarshalAsJSON(req, endpointResource); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -92,21 +97,23 @@ func (client *EndpointsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes the endpoint access to the target resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - options - EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method. func (client *EndpointsClient) Delete(ctx context.Context, resourceURI string, endpointName string, options *EndpointsClientDeleteOptions) (EndpointsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceURI, endpointName, options) if err != nil { return EndpointsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return EndpointsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientDeleteResponse{}, err } return EndpointsClientDeleteResponse{}, nil } @@ -121,7 +128,7 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,23 +137,26 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets the endpoint to the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - options - EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. func (client *EndpointsClient) Get(ctx context.Context, resourceURI string, endpointName string, options *EndpointsClientGetOptions) (EndpointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceURI, endpointName, options) if err != nil { return EndpointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -159,7 +169,7 @@ func (client *EndpointsClient) getCreateRequest(ctx context.Context, resourceURI return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,7 +186,7 @@ func (client *EndpointsClient) getHandleResponse(resp *http.Response) (Endpoints // NewListPager - List of endpoints to the target resource. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - options - EndpointsClientListOptions contains the optional parameters for the EndpointsClient.NewListPager method. func (client *EndpointsClient) NewListPager(resourceURI string, options *EndpointsClientListOptions) *runtime.Pager[EndpointsClientListResponse] { @@ -216,7 +226,7 @@ func (client *EndpointsClient) listCreateRequest(ctx context.Context, resourceUR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,24 +244,27 @@ func (client *EndpointsClient) listHandleResponse(resp *http.Response) (Endpoint // ListCredentials - Gets the endpoint access credentials to the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - options - EndpointsClientListCredentialsOptions contains the optional parameters for the EndpointsClient.ListCredentials // method. func (client *EndpointsClient) ListCredentials(ctx context.Context, resourceURI string, endpointName string, options *EndpointsClientListCredentialsOptions) (EndpointsClientListCredentialsResponse, error) { + var err error req, err := client.listCredentialsCreateRequest(ctx, resourceURI, endpointName, options) if err != nil { return EndpointsClientListCredentialsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientListCredentialsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientListCredentialsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientListCredentialsResponse{}, err } - return client.listCredentialsHandleResponse(resp) + resp, err := client.listCredentialsHandleResponse(httpResp) + return resp, err } // listCredentialsCreateRequest creates the ListCredentials request. @@ -264,12 +277,18 @@ func (client *EndpointsClient) listCredentialsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") if options != nil && options.Expiresin != nil { reqQP.Set("expiresin", strconv.FormatInt(*options.Expiresin, 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ListCredentialsRequest != nil { + if err := runtime.MarshalAsJSON(req, *options.ListCredentialsRequest); err != nil { + return nil, err + } + return req, nil + } return req, nil } @@ -282,28 +301,91 @@ func (client *EndpointsClient) listCredentialsHandleResponse(resp *http.Response return result, nil } +// ListIngressGatewayCredentials - Gets the ingress gateway endpoint credentials +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - options - EndpointsClientListIngressGatewayCredentialsOptions contains the optional parameters for the EndpointsClient.ListIngressGatewayCredentials +// method. +func (client *EndpointsClient) ListIngressGatewayCredentials(ctx context.Context, resourceURI string, endpointName string, options *EndpointsClientListIngressGatewayCredentialsOptions) (EndpointsClientListIngressGatewayCredentialsResponse, error) { + var err error + req, err := client.listIngressGatewayCredentialsCreateRequest(ctx, resourceURI, endpointName, options) + if err != nil { + return EndpointsClientListIngressGatewayCredentialsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return EndpointsClientListIngressGatewayCredentialsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientListIngressGatewayCredentialsResponse{}, err + } + resp, err := client.listIngressGatewayCredentialsHandleResponse(httpResp) + return resp, err +} + +// listIngressGatewayCredentialsCreateRequest creates the ListIngressGatewayCredentials request. +func (client *EndpointsClient) listIngressGatewayCredentialsCreateRequest(ctx context.Context, resourceURI string, endpointName string, options *EndpointsClientListIngressGatewayCredentialsOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listIngressGatewayCredentials" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + if options != nil && options.Expiresin != nil { + reqQP.Set("expiresin", strconv.FormatInt(*options.Expiresin, 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ListIngressGatewayCredentialsRequest != nil { + if err := runtime.MarshalAsJSON(req, *options.ListIngressGatewayCredentialsRequest); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// listIngressGatewayCredentialsHandleResponse handles the ListIngressGatewayCredentials response. +func (client *EndpointsClient) listIngressGatewayCredentialsHandleResponse(resp *http.Response) (EndpointsClientListIngressGatewayCredentialsResponse, error) { + result := EndpointsClientListIngressGatewayCredentialsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IngressGatewayResource); err != nil { + return EndpointsClientListIngressGatewayCredentialsResponse{}, err + } + return result, nil +} + // ListManagedProxyDetails - Fetches the managed proxy details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - managedProxyRequest - Object of type ManagedProxyRequest // - options - EndpointsClientListManagedProxyDetailsOptions contains the optional parameters for the EndpointsClient.ListManagedProxyDetails // method. func (client *EndpointsClient) ListManagedProxyDetails(ctx context.Context, resourceURI string, endpointName string, managedProxyRequest ManagedProxyRequest, options *EndpointsClientListManagedProxyDetailsOptions) (EndpointsClientListManagedProxyDetailsResponse, error) { + var err error req, err := client.listManagedProxyDetailsCreateRequest(ctx, resourceURI, endpointName, managedProxyRequest, options) if err != nil { return EndpointsClientListManagedProxyDetailsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientListManagedProxyDetailsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientListManagedProxyDetailsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientListManagedProxyDetailsResponse{}, err } - return client.listManagedProxyDetailsHandleResponse(resp) + resp, err := client.listManagedProxyDetailsHandleResponse(httpResp) + return resp, err } // listManagedProxyDetailsCreateRequest creates the ListManagedProxyDetails request. @@ -316,10 +398,13 @@ func (client *EndpointsClient) listManagedProxyDetailsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, managedProxyRequest) + if err := runtime.MarshalAsJSON(req, managedProxyRequest); err != nil { + return nil, err + } + return req, nil } // listManagedProxyDetailsHandleResponse handles the ListManagedProxyDetails response. @@ -334,24 +419,27 @@ func (client *EndpointsClient) listManagedProxyDetailsHandleResponse(resp *http. // Update - Update the endpoint to the target resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // - endpointName - The endpoint name. // - endpointResource - Endpoint details // - options - EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method. func (client *EndpointsClient) Update(ctx context.Context, resourceURI string, endpointName string, endpointResource EndpointResource, options *EndpointsClientUpdateOptions) (EndpointsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceURI, endpointName, endpointResource, options) if err != nil { return EndpointsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -364,10 +452,13 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpointResource) + if err := runtime.MarshalAsJSON(req, endpointResource); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go index 233cc477dcfd..977b6e8aca9a 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json func ExampleEndpointsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleEndpointsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsGetCustom.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json func ExampleEndpointsClient_Get_hybridConnectivityEndpointsGetCustom() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleEndpointsClient_Get_hybridConnectivityEndpointsGetCustom() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsGetDefault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetDefault.json func ExampleEndpointsClient_Get_hybridConnectivityEndpointsGetDefault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleEndpointsClient_Get_hybridConnectivityEndpointsGetDefault() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsPutCustom.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutCustom() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,7 +155,7 @@ func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutCustom( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsPutDefault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutDefault.json func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutDefault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -188,7 +188,7 @@ func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutDefault // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsPatchDefault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json func ExampleEndpointsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -221,7 +221,7 @@ func ExampleEndpointsClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsDeleteDefault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json func ExampleEndpointsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -238,7 +238,7 @@ func ExampleEndpointsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsPostListCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json func ExampleEndpointsClient_ListCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -249,7 +249,11 @@ func ExampleEndpointsClient_ListCredentials() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewEndpointsClient().ListCredentials(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", &armhybridconnectivity.EndpointsClientListCredentialsOptions{Expiresin: to.Ptr[int64](10800)}) + res, err := clientFactory.NewEndpointsClient().ListCredentials(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", &armhybridconnectivity.EndpointsClientListCredentialsOptions{Expiresin: to.Ptr[int64](10800), + ListCredentialsRequest: &armhybridconnectivity.ListCredentialsRequest{ + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + }, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -263,11 +267,51 @@ func ExampleEndpointsClient_ListCredentials() { // HybridConnectionName: to.Ptr("microsoft.kubernetes/connectedclusters/a0e1fd7d1d974ddf6b11a952d67679c9f12c006eee16861857a8268da4eb1498/1619989456957411072"), // NamespaceName: to.Ptr("azgnrelay-eastus-l1"), // NamespaceNameSuffix: to.Ptr("servicebus.windows.net"), + // ServiceConfigurationToken: to.Ptr("SSHvjqH=pTlKql=RtMGw/-k5VFBxSYHIiq5ZgbGFcLkNrDNz5fDsinCN2zkG"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json +func ExampleEndpointsClient_ListIngressGatewayCredentials() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewEndpointsClient().ListIngressGatewayCredentials(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0", "default", &armhybridconnectivity.EndpointsClientListIngressGatewayCredentialsOptions{Expiresin: to.Ptr[int64](10800), + ListIngressGatewayCredentialsRequest: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.IngressGatewayResource = armhybridconnectivity.IngressGatewayResource{ + // Ingress: &armhybridconnectivity.IngressProfileProperties{ + // AADProfile: &armhybridconnectivity.AADProfileProperties{ + // ServerID: to.Ptr("6256c85f-0aad-4d50-b960-e6e9b21efe35"), + // TenantID: to.Ptr("hy657tgh-8d16-42db-81b7-1234hygt67hy5"), + // }, + // Hostname: to.Ptr("clusterhostname"), + // }, + // Relay: &armhybridconnectivity.RelayNamespaceAccessProperties{ + // AccessKey: to.Ptr("SharedAccessSignature sr=http%3A%2F%2Fazgnrelay-eastus-l1.servicebus.windows.net%2Fmicrosoft.provisionedcluster%hci"), + // ExpiresOn: to.Ptr[int64](1620000256), + // HybridConnectionName: to.Ptr("microsoft.arcplaceholder/provisionedclusters/000/1619989456957411072"), + // NamespaceName: to.Ptr("relaynamespace"), + // NamespaceNameSuffix: to.Ptr("servicebus.windows.net"), + // ServiceConfigurationToken: to.Ptr("SSHvjqH=pTlKql=RtMGw/-k5VFBxSYHIiq5ZgbGFcLkNrDNz5fDsinCN2zkG"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/EndpointsPostListManagedProxyDetails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json func ExampleEndpointsClient_ListManagedProxyDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -279,8 +323,9 @@ func ExampleEndpointsClient_ListManagedProxyDetails() { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().ListManagedProxyDetails(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006", "default", armhybridconnectivity.ManagedProxyRequest{ - Hostname: to.Ptr("r.proxy.arc.com"), - Service: to.Ptr("127.0.0.1:65035"), + Hostname: to.Ptr("r.proxy.arc.com"), + Service: to.Ptr("127.0.0.1:65035"), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod index ce89b0b09410..8af446fffd4c 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/ go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect + github.com/golang-jwt/jwt/v5 v5.0.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect ) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.sum b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.sum index 8ba445a8c4da..545850a5189d 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.sum +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.sum @@ -1,15 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -18,14 +18,14 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go index e469114cf2ae..f4d4786c2664 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity @@ -43,56 +42,19 @@ type EndpointResource struct { // The endpoint properties. Properties *EndpointProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; System data of endpoint resource + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method. -type EndpointsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method. -type EndpointsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. -type EndpointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientListCredentialsOptions contains the optional parameters for the EndpointsClient.ListCredentials method. -type EndpointsClientListCredentialsOptions struct { - // The is how long the endpoint access token is valid (in seconds). - Expiresin *int64 -} - -// EndpointsClientListManagedProxyDetailsOptions contains the optional parameters for the EndpointsClient.ListManagedProxyDetails -// method. -type EndpointsClientListManagedProxyDetailsOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientListOptions contains the optional parameters for the EndpointsClient.NewListPager method. -type EndpointsClientListOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method. -type EndpointsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // EndpointsList - The list of endpoints. type EndpointsList struct { // The link used to get the next page of endpoints list. @@ -154,6 +116,18 @@ type IngressProfileProperties struct { Hostname *string } +// ListCredentialsRequest - The details of the service for which credentials needs to be returned. +type ListCredentialsRequest struct { + // The name of the service. If not provided, the request will by pass the generation of service configuration token + ServiceName *ServiceName +} + +// ListIngressGatewayCredentialsRequest - Represent ListIngressGatewayCredentials Request object. +type ListIngressGatewayCredentialsRequest struct { + // The name of the service. + ServiceName *ServiceName +} + // ManagedProxyRequest - Represent ManageProxy Request object. type ManagedProxyRequest struct { // REQUIRED; The name of the service. @@ -161,6 +135,10 @@ type ManagedProxyRequest struct { // The target host name. Hostname *string + + // The name of the service. It is an optional property, if not provided, service configuration tokens issue code would be + // by passed. + ServiceName *ServiceName } // ManagedProxyResource - Managed Proxy @@ -221,20 +199,18 @@ type OperationListResult struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -253,22 +229,82 @@ type RelayNamespaceAccessProperties struct { // The expiration of access key in unix time. ExpiresOn *int64 + // The token to access the enabled service. + ServiceConfigurationToken *string + // READ-ONLY; Access key for hybrid connection. AccessKey *string } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ServiceConfigurationList - The paginated list of serviceConfigurations +type ServiceConfigurationList struct { + // The link to fetch the next page of connected cluster + NextLink *string + + // The list of service configuration + Value []*ServiceConfigurationResource +} + +// ServiceConfigurationProperties - Service configuration details +type ServiceConfigurationProperties struct { + // REQUIRED; Name of the service. + ServiceName *ServiceName + + // The port on which service is enabled. + Port *int64 + + // The resource Id of the connectivity endpoint (optional). + ResourceID *string + + // READ-ONLY; The resource provisioning state. + ProvisioningState *ProvisioningState +} + +// ServiceConfigurationPropertiesPatch - Service configuration details +type ServiceConfigurationPropertiesPatch struct { + // The port on which service is enabled. + Port *int64 +} + +// ServiceConfigurationResource - The service configuration details associated with the target resource. +type ServiceConfigurationResource struct { + // The service configuration properties. + Properties *ServiceConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ServiceConfigurationResourcePatch - The service details under service configuration for the target endpoint resource. +type ServiceConfigurationResourcePatch struct { + // The service configuration properties. + Properties *ServiceConfigurationPropertiesPatch +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go index f483d08347c0..0b1f470e879a 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity @@ -346,11 +345,66 @@ func (i *IngressProfileProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ListCredentialsRequest. +func (l ListCredentialsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceName", l.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListCredentialsRequest. +func (l *ListCredentialsRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceName": + err = unpopulate(val, "ServiceName", &l.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListIngressGatewayCredentialsRequest. +func (l ListIngressGatewayCredentialsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceName", l.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListIngressGatewayCredentialsRequest. +func (l *ListIngressGatewayCredentialsRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceName": + err = unpopulate(val, "ServiceName", &l.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedProxyRequest. func (m ManagedProxyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "hostname", m.Hostname) populate(objectMap, "service", m.Service) + populate(objectMap, "serviceName", m.ServiceName) return json.Marshal(objectMap) } @@ -369,6 +423,9 @@ func (m *ManagedProxyRequest) UnmarshalJSON(data []byte) error { case "service": err = unpopulate(val, "Service", &m.Service) delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &m.ServiceName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -526,6 +583,7 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -545,6 +603,9 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -564,6 +625,7 @@ func (r RelayNamespaceAccessProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "hybridConnectionName", r.HybridConnectionName) populate(objectMap, "namespaceName", r.NamespaceName) populate(objectMap, "namespaceNameSuffix", r.NamespaceNameSuffix) + populate(objectMap, "serviceConfigurationToken", r.ServiceConfigurationToken) return json.Marshal(objectMap) } @@ -591,6 +653,9 @@ func (r *RelayNamespaceAccessProperties) UnmarshalJSON(data []byte) error { case "namespaceNameSuffix": err = unpopulate(val, "NamespaceNameSuffix", &r.NamespaceNameSuffix) delete(rawMsg, key) + case "serviceConfigurationToken": + err = unpopulate(val, "ServiceConfigurationToken", &r.ServiceConfigurationToken) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -604,6 +669,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -623,6 +689,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -634,6 +703,173 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceConfigurationList. +func (s ServiceConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigurationList. +func (s *ServiceConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceConfigurationProperties. +func (s ServiceConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", s.Port) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "serviceName", s.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigurationProperties. +func (s *ServiceConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &s.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceConfigurationPropertiesPatch. +func (s ServiceConfigurationPropertiesPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", s.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigurationPropertiesPatch. +func (s *ServiceConfigurationPropertiesPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceConfigurationResource. +func (s ServiceConfigurationResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigurationResource. +func (s *ServiceConfigurationResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceConfigurationResourcePatch. +func (s ServiceConfigurationResourcePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigurationResourcePatch. +func (s *ServiceConfigurationResourcePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client.go index 8e73fcfccce1..83c6f8ead5a5 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists the available Hybrid Connectivity REST API operations. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-03-15 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-03-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go index 0c365c566a12..c6b38498e358 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2022-05-01-preview/examples/OperationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/options.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/options.go new file mode 100644 index 000000000000..9ea1b3fdaa4a --- /dev/null +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/options.go @@ -0,0 +1,91 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armhybridconnectivity + +// EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method. +type EndpointsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method. +type EndpointsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. +type EndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientListCredentialsOptions contains the optional parameters for the EndpointsClient.ListCredentials method. +type EndpointsClientListCredentialsOptions struct { + // The is how long the endpoint access token is valid (in seconds). + Expiresin *int64 + + // Object of type ListCredentialsRequest + ListCredentialsRequest *ListCredentialsRequest +} + +// EndpointsClientListIngressGatewayCredentialsOptions contains the optional parameters for the EndpointsClient.ListIngressGatewayCredentials +// method. +type EndpointsClientListIngressGatewayCredentialsOptions struct { + // The is how long the endpoint access token is valid (in seconds). + Expiresin *int64 + + // Object of type ListIngressGatewayCredentialsRequest + ListIngressGatewayCredentialsRequest *ListIngressGatewayCredentialsRequest +} + +// EndpointsClientListManagedProxyDetailsOptions contains the optional parameters for the EndpointsClient.ListManagedProxyDetails +// method. +type EndpointsClientListManagedProxyDetailsOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientListOptions contains the optional parameters for the EndpointsClient.NewListPager method. +type EndpointsClientListOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method. +type EndpointsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceConfigurationsClientCreateOrupdateOptions contains the optional parameters for the ServiceConfigurationsClient.CreateOrupdate +// method. +type ServiceConfigurationsClientCreateOrupdateOptions struct { + // placeholder for future optional parameters +} + +// ServiceConfigurationsClientDeleteOptions contains the optional parameters for the ServiceConfigurationsClient.Delete method. +type ServiceConfigurationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ServiceConfigurationsClientGetOptions contains the optional parameters for the ServiceConfigurationsClient.Get method. +type ServiceConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceConfigurationsClientListByEndpointResourceOptions contains the optional parameters for the ServiceConfigurationsClient.NewListByEndpointResourcePager +// method. +type ServiceConfigurationsClientListByEndpointResourceOptions struct { + // placeholder for future optional parameters +} + +// ServiceConfigurationsClientUpdateOptions contains the optional parameters for the ServiceConfigurationsClient.Update method. +type ServiceConfigurationsClientUpdateOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/response_types.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/response_types.go index f4e9167aaf65..56d2a363d1d4 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/response_types.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/response_types.go @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity // EndpointsClientCreateOrUpdateResponse contains the response from method EndpointsClient.CreateOrUpdate. type EndpointsClientCreateOrUpdateResponse struct { + // The endpoint for the target resource. EndpointResource } @@ -21,30 +21,71 @@ type EndpointsClientDeleteResponse struct { // EndpointsClientGetResponse contains the response from method EndpointsClient.Get. type EndpointsClientGetResponse struct { + // The endpoint for the target resource. EndpointResource } // EndpointsClientListCredentialsResponse contains the response from method EndpointsClient.ListCredentials. type EndpointsClientListCredentialsResponse struct { + // The endpoint access for the target resource. EndpointAccessResource } +// EndpointsClientListIngressGatewayCredentialsResponse contains the response from method EndpointsClient.ListIngressGatewayCredentials. +type EndpointsClientListIngressGatewayCredentialsResponse struct { + // The ingress gateway access credentials + IngressGatewayResource +} + // EndpointsClientListManagedProxyDetailsResponse contains the response from method EndpointsClient.ListManagedProxyDetails. type EndpointsClientListManagedProxyDetailsResponse struct { + // Managed Proxy ManagedProxyResource } // EndpointsClientListResponse contains the response from method EndpointsClient.NewListPager. type EndpointsClientListResponse struct { + // The list of endpoints. EndpointsList } // EndpointsClientUpdateResponse contains the response from method EndpointsClient.Update. type EndpointsClientUpdateResponse struct { + // The endpoint for the target resource. EndpointResource } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } + +// ServiceConfigurationsClientCreateOrupdateResponse contains the response from method ServiceConfigurationsClient.CreateOrupdate. +type ServiceConfigurationsClientCreateOrupdateResponse struct { + // The service configuration details associated with the target resource. + ServiceConfigurationResource +} + +// ServiceConfigurationsClientDeleteResponse contains the response from method ServiceConfigurationsClient.Delete. +type ServiceConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// ServiceConfigurationsClientGetResponse contains the response from method ServiceConfigurationsClient.Get. +type ServiceConfigurationsClientGetResponse struct { + // The service configuration details associated with the target resource. + ServiceConfigurationResource +} + +// ServiceConfigurationsClientListByEndpointResourceResponse contains the response from method ServiceConfigurationsClient.NewListByEndpointResourcePager. +type ServiceConfigurationsClientListByEndpointResourceResponse struct { + // The paginated list of serviceConfigurations + ServiceConfigurationList +} + +// ServiceConfigurationsClientUpdateResponse contains the response from method ServiceConfigurationsClient.Update. +type ServiceConfigurationsClientUpdateResponse struct { + // The service configuration details associated with the target resource. + ServiceConfigurationResource +} diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client.go new file mode 100644 index 000000000000..1974c138b0f0 --- /dev/null +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client.go @@ -0,0 +1,309 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armhybridconnectivity + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "strings" +) + +// ServiceConfigurationsClient contains the methods for the ServiceConfigurations group. +// Don't use this type directly, use NewServiceConfigurationsClient() instead. +type ServiceConfigurationsClient struct { + internal *arm.Client +} + +// NewServiceConfigurationsClient creates a new instance of ServiceConfigurationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceConfigurationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceConfigurationsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrupdate - Create or update a service in serviceConfiguration for the endpoint resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - serviceConfigurationName - The service name. +// - serviceConfigurationResource - Service details +// - options - ServiceConfigurationsClientCreateOrupdateOptions contains the optional parameters for the ServiceConfigurationsClient.CreateOrupdate +// method. +func (client *ServiceConfigurationsClient) CreateOrupdate(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, serviceConfigurationResource ServiceConfigurationResource, options *ServiceConfigurationsClientCreateOrupdateOptions) (ServiceConfigurationsClientCreateOrupdateResponse, error) { + var err error + req, err := client.createOrupdateCreateRequest(ctx, resourceURI, endpointName, serviceConfigurationName, serviceConfigurationResource, options) + if err != nil { + return ServiceConfigurationsClientCreateOrupdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceConfigurationsClientCreateOrupdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ServiceConfigurationsClientCreateOrupdateResponse{}, err + } + resp, err := client.createOrupdateHandleResponse(httpResp) + return resp, err +} + +// createOrupdateCreateRequest creates the CreateOrupdate request. +func (client *ServiceConfigurationsClient) createOrupdateCreateRequest(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, serviceConfigurationResource ServiceConfigurationResource, options *ServiceConfigurationsClientCreateOrupdateOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + urlPath = strings.ReplaceAll(urlPath, "{serviceConfigurationName}", serviceConfigurationName) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, serviceConfigurationResource); err != nil { + return nil, err + } + return req, nil +} + +// createOrupdateHandleResponse handles the CreateOrupdate response. +func (client *ServiceConfigurationsClient) createOrupdateHandleResponse(resp *http.Response) (ServiceConfigurationsClientCreateOrupdateResponse, error) { + result := ServiceConfigurationsClientCreateOrupdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceConfigurationResource); err != nil { + return ServiceConfigurationsClientCreateOrupdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the service details to the target resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - serviceConfigurationName - The service name. +// - options - ServiceConfigurationsClientDeleteOptions contains the optional parameters for the ServiceConfigurationsClient.Delete +// method. +func (client *ServiceConfigurationsClient) Delete(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, options *ServiceConfigurationsClientDeleteOptions) (ServiceConfigurationsClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceURI, endpointName, serviceConfigurationName, options) + if err != nil { + return ServiceConfigurationsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceConfigurationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ServiceConfigurationsClientDeleteResponse{}, err + } + return ServiceConfigurationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServiceConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, options *ServiceConfigurationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + urlPath = strings.ReplaceAll(urlPath, "{serviceConfigurationName}", serviceConfigurationName) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details about the service to the resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - serviceConfigurationName - The service name. +// - options - ServiceConfigurationsClientGetOptions contains the optional parameters for the ServiceConfigurationsClient.Get +// method. +func (client *ServiceConfigurationsClient) Get(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, options *ServiceConfigurationsClientGetOptions) (ServiceConfigurationsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceURI, endpointName, serviceConfigurationName, options) + if err != nil { + return ServiceConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ServiceConfigurationsClient) getCreateRequest(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, options *ServiceConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + urlPath = strings.ReplaceAll(urlPath, "{serviceConfigurationName}", serviceConfigurationName) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServiceConfigurationsClient) getHandleResponse(resp *http.Response) (ServiceConfigurationsClientGetResponse, error) { + result := ServiceConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceConfigurationResource); err != nil { + return ServiceConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByEndpointResourcePager - API to enumerate registered services in service configurations under a Endpoint Resource +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - options - ServiceConfigurationsClientListByEndpointResourceOptions contains the optional parameters for the ServiceConfigurationsClient.NewListByEndpointResourcePager +// method. +func (client *ServiceConfigurationsClient) NewListByEndpointResourcePager(resourceURI string, endpointName string, options *ServiceConfigurationsClientListByEndpointResourceOptions) *runtime.Pager[ServiceConfigurationsClientListByEndpointResourceResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceConfigurationsClientListByEndpointResourceResponse]{ + More: func(page ServiceConfigurationsClientListByEndpointResourceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceConfigurationsClientListByEndpointResourceResponse) (ServiceConfigurationsClientListByEndpointResourceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByEndpointResourceCreateRequest(ctx, resourceURI, endpointName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceConfigurationsClientListByEndpointResourceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceConfigurationsClientListByEndpointResourceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceConfigurationsClientListByEndpointResourceResponse{}, runtime.NewResponseError(resp) + } + return client.listByEndpointResourceHandleResponse(resp) + }, + }) +} + +// listByEndpointResourceCreateRequest creates the ListByEndpointResource request. +func (client *ServiceConfigurationsClient) listByEndpointResourceCreateRequest(ctx context.Context, resourceURI string, endpointName string, options *ServiceConfigurationsClientListByEndpointResourceOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByEndpointResourceHandleResponse handles the ListByEndpointResource response. +func (client *ServiceConfigurationsClient) listByEndpointResourceHandleResponse(resp *http.Response) (ServiceConfigurationsClientListByEndpointResourceResponse, error) { + result := ServiceConfigurationsClientListByEndpointResourceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceConfigurationList); err != nil { + return ServiceConfigurationsClientListByEndpointResourceResponse{}, err + } + return result, nil +} + +// Update - Update the service details in the service configurations of the target resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15 +// - resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. +// - endpointName - The endpoint name. +// - serviceConfigurationName - The service name. +// - serviceConfigurationResource - Service details +// - options - ServiceConfigurationsClientUpdateOptions contains the optional parameters for the ServiceConfigurationsClient.Update +// method. +func (client *ServiceConfigurationsClient) Update(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, serviceConfigurationResource ServiceConfigurationResourcePatch, options *ServiceConfigurationsClientUpdateOptions) (ServiceConfigurationsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceURI, endpointName, serviceConfigurationName, serviceConfigurationResource, options) + if err != nil { + return ServiceConfigurationsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceConfigurationsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceConfigurationsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ServiceConfigurationsClient) updateCreateRequest(ctx context.Context, resourceURI string, endpointName string, serviceConfigurationName string, serviceConfigurationResource ServiceConfigurationResourcePatch, options *ServiceConfigurationsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", endpointName) + urlPath = strings.ReplaceAll(urlPath, "{serviceConfigurationName}", serviceConfigurationName) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, serviceConfigurationResource); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ServiceConfigurationsClient) updateHandleResponse(resp *http.Response) (ServiceConfigurationsClientUpdateResponse, error) { + result := ServiceConfigurationsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceConfigurationResource); err != nil { + return ServiceConfigurationsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go new file mode 100644 index 000000000000..59b2813f785e --- /dev/null +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go @@ -0,0 +1,235 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybridconnectivity_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json +func ExampleServiceConfigurationsClient_NewListByEndpointResourcePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServiceConfigurationsClient().NewListByEndpointResourcePager("subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ServiceConfigurationList = armhybridconnectivity.ServiceConfigurationList{ + // Value: []*armhybridconnectivity.ServiceConfigurationResource{ + // { + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](22), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + // }, + // }, + // { + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/WAC"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](6516), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json +func ExampleServiceConfigurationsClient_Get_hybridConnectivityEndpointsServiceconfigurationsGetSsh() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceConfigurationsClient().Get(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceConfigurationResource = armhybridconnectivity.ServiceConfigurationResource{ + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](22), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetWAC.json +func ExampleServiceConfigurationsClient_Get_hybridConnectivityEndpointsServiceconfigurationsGetWac() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceConfigurationsClient().Get(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "WAC", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceConfigurationResource = armhybridconnectivity.ServiceConfigurationResource{ + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/WAC"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](6516), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json +func ExampleServiceConfigurationsClient_CreateOrupdate_serviceConfigurationsPutSsh() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResource{ + Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + Port: to.Ptr[int64](22), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceConfigurationResource = armhybridconnectivity.ServiceConfigurationResource{ + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](22), + // ProvisioningState: to.Ptr(armhybridconnectivity.ProvisioningStateSucceeded), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutWAC.json +func ExampleServiceConfigurationsClient_CreateOrupdate_serviceConfigurationsPutWac() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "WAC", armhybridconnectivity.ServiceConfigurationResource{ + Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + Port: to.Ptr[int64](6516), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceConfigurationResource = armhybridconnectivity.ServiceConfigurationResource{ + // Type: to.Ptr("Microsoft.HybridConnectivity/endpoints/serviceConfigurations"), + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/WAC"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](6516), + // ProvisioningState: to.Ptr(armhybridconnectivity.ProvisioningStateSucceeded), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json +func ExampleServiceConfigurationsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServiceConfigurationsClient().Update(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResourcePatch{ + Properties: &armhybridconnectivity.ServiceConfigurationPropertiesPatch{ + Port: to.Ptr[int64](22), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceConfigurationResource = armhybridconnectivity.ServiceConfigurationResource{ + // ID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default/serviceConfigurations/SSH"), + // Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + // Port: to.Ptr[int64](22), + // ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json +func ExampleServiceConfigurationsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewServiceConfigurationsClient().Delete(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/time_rfc3339.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/time_rfc3339.go index c733572abfb4..49b9c03bdfdc 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/time_rfc3339.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridconnectivity