From 621a9aed58d56b8949b200ca86024c5a77adb81e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 27 Jul 2019 00:21:57 +0000 Subject: [PATCH 1/2] Generated from e7db358c5315df0cb643c73c84078fd751c90031 Update readme.md --- .../subscription/mgmt/subscription/models.go | 10 -- .../subscription/subscriptionapi/models.go | 1 - .../2018-03-01-preview/subscription/models.go | 44 ++----- .../subscription/operations.go | 4 +- .../subscription/operationsgroup.go | 109 ------------------ .../subscriptionapi/interfaces.go | 7 -- 6 files changed, 10 insertions(+), 165 deletions(-) delete mode 100644 services/preview/subscription/mgmt/2018-03-01-preview/subscription/operationsgroup.go diff --git a/profiles/preview/preview/subscription/mgmt/subscription/models.go b/profiles/preview/preview/subscription/mgmt/subscription/models.go index 1e425bd847f0..90ba0be92c49 100644 --- a/profiles/preview/preview/subscription/mgmt/subscription/models.go +++ b/profiles/preview/preview/subscription/mgmt/subscription/models.go @@ -68,12 +68,8 @@ type Location = original.Location type LocationListResult = original.LocationListResult type Model = original.Model type Operation = original.Operation -type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult -type OperationListResultType = original.OperationListResultType -type OperationType = original.OperationType type OperationsClient = original.OperationsClient -type OperationsGroupClient = original.OperationsGroupClient type Policies = original.Policies type SubscriptionsClient = original.SubscriptionsClient type TenantIDDescription = original.TenantIDDescription @@ -103,12 +99,6 @@ func NewOperationsClient() OperationsClient { func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI) } -func NewOperationsGroupClient() OperationsGroupClient { - return original.NewOperationsGroupClient() -} -func NewOperationsGroupClientWithBaseURI(baseURI string) OperationsGroupClient { - return original.NewOperationsGroupClientWithBaseURI(baseURI) -} func NewSubscriptionsClient() SubscriptionsClient { return original.NewSubscriptionsClient() } diff --git a/profiles/preview/preview/subscription/mgmt/subscription/subscriptionapi/models.go b/profiles/preview/preview/subscription/mgmt/subscription/subscriptionapi/models.go index 9df51c367d22..20c781c071be 100644 --- a/profiles/preview/preview/subscription/mgmt/subscription/subscriptionapi/models.go +++ b/profiles/preview/preview/subscription/mgmt/subscription/subscriptionapi/models.go @@ -23,6 +23,5 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/subscription type FactoryClientAPI = original.FactoryClientAPI type OperationsClientAPI = original.OperationsClientAPI -type OperationsGroupClientAPI = original.OperationsGroupClientAPI type SubscriptionsClientAPI = original.SubscriptionsClientAPI type TenantsClientAPI = original.TenantsClientAPI diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go index 72122f92c17f..48862674e078 100644 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go +++ b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go @@ -349,43 +349,8 @@ type Model struct { AuthorizationSource *string `json:"authorizationSource,omitempty"` } -// Operation REST API operation +// Operation status of the subscription POST operation. type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - The object that represents the operation. - Display *OperationDisplay `json:"display,omitempty"` -} - -// OperationDisplay the object that represents the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft.Subscription - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed: Profile, endpoint, etc. - Resource *string `json:"resource,omitempty"` - // Operation - Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` -} - -// OperationListResult result of the request to list operations. It contains a list of operations and a URL -// link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of operations. - Value *[]Operation `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// OperationListResultType a list of pending subscription operations. -type OperationListResultType struct { - autorest.Response `json:"-"` - // Value - A list of pending SubscriptionOperations - Value *[]OperationType `json:"value,omitempty"` -} - -// OperationType status of the subscription POST operation. -type OperationType struct { // ID - READ-ONLY; The operation Id. ID *string `json:"id,omitempty"` // Status - Status of the pending subscription @@ -394,6 +359,13 @@ type OperationType struct { StatusDetail *string `json:"statusDetail,omitempty"` } +// OperationListResult a list of pending subscription operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - A list of pending SubscriptionOperations + Value *[]Operation `json:"value,omitempty"` +} + // Policies subscription policies. type Policies struct { // LocationPlacementID - READ-ONLY; The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operations.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operations.go index 635555a489a2..5163b5ef878e 100644 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operations.go +++ b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operations.go @@ -40,7 +40,7 @@ func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI)} } -// List lists all of the available Microsoft.Subscription API operations. +// List lists all of the available pending Microsoft.Subscription API operations. func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") @@ -83,7 +83,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Subscription/operations"), + autorest.WithPath("/providers/Microsoft.Subscription/subscriptionOperations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operationsgroup.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operationsgroup.go deleted file mode 100644 index 188943980051..000000000000 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/operationsgroup.go +++ /dev/null @@ -1,109 +0,0 @@ -package subscription - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsGroupClient is the the subscription client -type OperationsGroupClient struct { - BaseClient -} - -// NewOperationsGroupClient creates an instance of the OperationsGroupClient client. -func NewOperationsGroupClient() OperationsGroupClient { - return NewOperationsGroupClientWithBaseURI(DefaultBaseURI) -} - -// NewOperationsGroupClientWithBaseURI creates an instance of the OperationsGroupClient client. -func NewOperationsGroupClientWithBaseURI(baseURI string) OperationsGroupClient { - return OperationsGroupClient{NewWithBaseURI(baseURI)} -} - -// List lists all of the available pending Microsoft.Subscription API operations. -func (client OperationsGroupClient) List(ctx context.Context) (result OperationListResultType, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsGroupClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "subscription.OperationsGroupClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "subscription.OperationsGroupClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "subscription.OperationsGroupClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Subscription/subscriptionOperations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsGroupClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsGroupClient) ListResponder(resp *http.Response) (result OperationListResultType, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/subscriptionapi/interfaces.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/subscriptionapi/interfaces.go index 97f10863bad0..0dcc6ed61329 100644 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/subscriptionapi/interfaces.go +++ b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/subscriptionapi/interfaces.go @@ -29,13 +29,6 @@ type OperationsClientAPI interface { var _ OperationsClientAPI = (*subscription.OperationsClient)(nil) -// OperationsGroupClientAPI contains the set of methods on the OperationsGroupClient type. -type OperationsGroupClientAPI interface { - List(ctx context.Context) (result subscription.OperationListResultType, err error) -} - -var _ OperationsGroupClientAPI = (*subscription.OperationsGroupClient)(nil) - // FactoryClientAPI contains the set of methods on the FactoryClient type. type FactoryClientAPI interface { CreateSubscriptionInEnrollmentAccount(ctx context.Context, enrollmentAccountName string, body subscription.CreationParameters) (result subscription.FactoryCreateSubscriptionInEnrollmentAccountFuture, err error) From f2e9eb080463b5b5a37f7f41e59d95d389f0e6e0 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 29 Jul 2019 19:04:44 +0000 Subject: [PATCH 2/2] Generated from be9b791408e4113c2462d9df4c1b31c7d59dff09 Textual changes --- .../mgmt/2018-03-01-preview/subscription/models.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go index 48862674e078..8863260e24a2 100644 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go +++ b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go @@ -83,7 +83,7 @@ func PossibleStateValues() []State { return []State{Deleted, Disabled, Enabled, PastDue, Warned} } -// AdPrincipal active Directory Principal for subscription creation delegated permission +// AdPrincipal active Directory Principal who’ll get owner access on the new subscription. type AdPrincipal struct { // ObjectID - Object id of the Principal ObjectID *string `json:"objectId,omitempty"` @@ -122,7 +122,7 @@ func (cp CreationParameters) MarshalJSON() ([]byte, error) { // CreationResult the created subscription object. type CreationResult struct { autorest.Response `json:"-"` - // SubscriptionLink - The link to the new subscription. + // SubscriptionLink - The link to the new subscription. Use this link to check the status of subscription creation operation. SubscriptionLink *string `json:"subscriptionLink,omitempty"` }