diff --git a/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go b/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go index 1384b68307a6..cfec3dc55496 100644 --- a/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go +++ b/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go @@ -25,7 +25,6 @@ type AccountBillingPermissionsClientAPI = original.AccountBillingPermissionsClie type AccountBillingRoleAssignmentClientAPI = original.AccountBillingRoleAssignmentClientAPI type AccountBillingRoleDefinitionClientAPI = original.AccountBillingRoleDefinitionClientAPI type AccountsClientAPI = original.AccountsClientAPI -type AccountsWithCreateInvoiceSectionPermissionClientAPI = original.AccountsWithCreateInvoiceSectionPermissionClientAPI type AgreementsClientAPI = original.AgreementsClientAPI type AvailableBalanceByBillingProfileClientAPI = original.AvailableBalanceByBillingProfileClientAPI type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/preview/preview/billing/mgmt/billing/models.go b/profiles/preview/preview/billing/mgmt/billing/models.go index 0bff360ec415..cd715a15c9f6 100644 --- a/profiles/preview/preview/billing/mgmt/billing/models.go +++ b/profiles/preview/preview/billing/mgmt/billing/models.go @@ -158,7 +158,6 @@ type AccountBillingRoleDefinitionClient = original.AccountBillingRoleDefinitionC type AccountListResult = original.AccountListResult type AccountProperties = original.AccountProperties type AccountsClient = original.AccountsClient -type AccountsWithCreateInvoiceSectionPermissionClient = original.AccountsWithCreateInvoiceSectionPermissionClient type Address = original.Address type Agreement = original.Agreement type AgreementListResult = original.AgreementListResult @@ -251,6 +250,7 @@ type ProfilesClient = original.ProfilesClient type ProfilesUpdateFuture = original.ProfilesUpdateFuture type Property = original.Property type PropertyClient = original.PropertyClient +type PropertySummary = original.PropertySummary type RecipientTransferDetails = original.RecipientTransferDetails type RecipientTransferDetailsListResult = original.RecipientTransferDetailsListResult type RecipientTransferDetailsListResultIterator = original.RecipientTransferDetailsListResultIterator @@ -324,12 +324,6 @@ func NewAccountsClient(subscriptionID string) AccountsClient { func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewAccountsWithCreateInvoiceSectionPermissionClient(subscriptionID string) AccountsWithCreateInvoiceSectionPermissionClient { - return original.NewAccountsWithCreateInvoiceSectionPermissionClient(subscriptionID) -} -func NewAccountsWithCreateInvoiceSectionPermissionClientWithBaseURI(baseURI string, subscriptionID string) AccountsWithCreateInvoiceSectionPermissionClient { - return original.NewAccountsWithCreateInvoiceSectionPermissionClientWithBaseURI(baseURI, subscriptionID) -} func NewAgreementsClient(subscriptionID string) AgreementsClient { return original.NewAgreementsClient(subscriptionID) } diff --git a/services/preview/billing/mgmt/2018-11-01-preview/billing/accountswithcreateinvoicesectionpermission.go b/services/preview/billing/mgmt/2018-11-01-preview/billing/accountswithcreateinvoicesectionpermission.go deleted file mode 100644 index e853a87853f7..000000000000 --- a/services/preview/billing/mgmt/2018-11-01-preview/billing/accountswithcreateinvoicesectionpermission.go +++ /dev/null @@ -1,117 +0,0 @@ -package billing - -// 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" -) - -// AccountsWithCreateInvoiceSectionPermissionClient is the billing client provides access to billing resources for -// Azure subscriptions. -type AccountsWithCreateInvoiceSectionPermissionClient struct { - BaseClient -} - -// NewAccountsWithCreateInvoiceSectionPermissionClient creates an instance of the -// AccountsWithCreateInvoiceSectionPermissionClient client. -func NewAccountsWithCreateInvoiceSectionPermissionClient(subscriptionID string) AccountsWithCreateInvoiceSectionPermissionClient { - return NewAccountsWithCreateInvoiceSectionPermissionClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountsWithCreateInvoiceSectionPermissionClientWithBaseURI creates an instance of the -// AccountsWithCreateInvoiceSectionPermissionClient client. -func NewAccountsWithCreateInvoiceSectionPermissionClientWithBaseURI(baseURI string, subscriptionID string) AccountsWithCreateInvoiceSectionPermissionClient { - return AccountsWithCreateInvoiceSectionPermissionClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all billing accounts with create invoiceSection permission for a user. -// Parameters: -// expand - may be used to expand the invoiceSections and billingProfiles. -func (client AccountsWithCreateInvoiceSectionPermissionClient) List(ctx context.Context, expand string) (result AccountListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsWithCreateInvoiceSectionPermissionClient.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, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "billing.AccountsWithCreateInvoiceSectionPermissionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "billing.AccountsWithCreateInvoiceSectionPermissionClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "billing.AccountsWithCreateInvoiceSectionPermissionClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AccountsWithCreateInvoiceSectionPermissionClient) ListPreparer(ctx context.Context, expand string) (*http.Request, error) { - const APIVersion = "2018-11-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Billing/listBillingAccountsWithCreateInvoiceSectionPermission"), - 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 AccountsWithCreateInvoiceSectionPermissionClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AccountsWithCreateInvoiceSectionPermissionClient) ListResponder(resp *http.Response) (result AccountListResult, 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/billing/mgmt/2018-11-01-preview/billing/billingapi/interfaces.go b/services/preview/billing/mgmt/2018-11-01-preview/billing/billingapi/interfaces.go index 56756914c8b7..e663c2c3a61f 100644 --- a/services/preview/billing/mgmt/2018-11-01-preview/billing/billingapi/interfaces.go +++ b/services/preview/billing/mgmt/2018-11-01-preview/billing/billingapi/interfaces.go @@ -39,13 +39,6 @@ type AccountsClientAPI interface { var _ AccountsClientAPI = (*billing.AccountsClient)(nil) -// AccountsWithCreateInvoiceSectionPermissionClientAPI contains the set of methods on the AccountsWithCreateInvoiceSectionPermissionClient type. -type AccountsWithCreateInvoiceSectionPermissionClientAPI interface { - List(ctx context.Context, expand string) (result billing.AccountListResult, err error) -} - -var _ AccountsWithCreateInvoiceSectionPermissionClientAPI = (*billing.AccountsWithCreateInvoiceSectionPermissionClient)(nil) - // AvailableBalanceByBillingProfileClientAPI contains the set of methods on the AvailableBalanceByBillingProfileClient type. type AvailableBalanceByBillingProfileClientAPI interface { Get(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.AvailableBalance, err error) diff --git a/services/preview/billing/mgmt/2018-11-01-preview/billing/models.go b/services/preview/billing/mgmt/2018-11-01-preview/billing/models.go index 253eb5c49a01..302bd9b84f11 100644 --- a/services/preview/billing/mgmt/2018-11-01-preview/billing/models.go +++ b/services/preview/billing/mgmt/2018-11-01-preview/billing/models.go @@ -426,17 +426,17 @@ type AccountListResult struct { type AccountProperties struct { // DisplayName - The billing account name. DisplayName *string `json:"displayName,omitempty"` - // Company - The Company this billing account belongs to. - Company *string `json:"company,omitempty"` // AccountType - The billing account Type. Possible values include: 'AccountTypeOrganization', 'AccountTypeEnrollment' AccountType AccountType `json:"accountType,omitempty"` // Address - The address associated with billing account. Address *Address `json:"address,omitempty"` - // Country - The country associated with billing account.. + // Company - Company Name. + Company *string `json:"company,omitempty"` + // Country - Country Name. Country *string `json:"country,omitempty"` - // InvoiceSections - The invoice sections associated to the billing account. + // InvoiceSections - The invoice sections associated to the billing account. By default this is not populated, unless it's specified in $expand. InvoiceSections *[]InvoiceSection `json:"invoiceSections,omitempty"` - // BillingProfiles - The billing profiles associated to the billing account. + // BillingProfiles - The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. BillingProfiles *[]Profile `json:"billingProfiles,omitempty"` // EnrollmentDetails - The details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. EnrollmentDetails *Enrollment `json:"enrollmentDetails,omitempty"` @@ -444,6 +444,8 @@ type AccountProperties struct { Departments *[]Department `json:"departments,omitempty"` // EnrollmentAccounts - The accounts associated to the enrollment. EnrollmentAccounts *[]EnrollmentAccount `json:"enrollmentAccounts,omitempty"` + // HasReadAccess - Specifies whether the user has read access on billing account. + HasReadAccess *bool `json:"hasReadAccess,omitempty"` } // Address address details. @@ -802,7 +804,7 @@ type DownloadURL struct { URL *string `json:"url,omitempty"` } -// EnabledAzureSKUs details about the product. +// EnabledAzureSKUs details about the enabled azure sku. type EnabledAzureSKUs struct { // SkuID - The sku id. SkuID *string `json:"skuId,omitempty"` @@ -1330,9 +1332,9 @@ type InvoiceSummaryProperties struct { InvoicePeriodStartDate *date.Time `json:"invoicePeriodStartDate,omitempty"` // InvoicePeriodEndDate - The end date of the billing period. InvoicePeriodEndDate *date.Time `json:"invoicePeriodEndDate,omitempty"` - // BillingProfile - The profile id which invoice belongs to. - BillingProfile *string `json:"billingProfile,omitempty"` - // BillingProfileName - The profile name which invoice belongs to. + // BillingProfileID - The billing profile id this invoice belongs to. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileName - The profile name this invoice belongs to. BillingProfileName *string `json:"billingProfileName,omitempty"` // PurchaseOrderNumber - The purchase identifier for the invoice. PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` @@ -1609,8 +1611,8 @@ func (pm *PaymentMethod) UnmarshalJSON(body []byte) error { // PaymentMethodProperties the properties of the payment method. type PaymentMethodProperties struct { - // MethodType - Payment method type. Possible values include: 'Credits', 'ChequeWire' - MethodType PaymentMethodType `json:"methodType,omitempty"` + // PaymentMethodType - Payment method type. Possible values include: 'Credits', 'ChequeWire' + PaymentMethodType PaymentMethodType `json:"paymentMethodType,omitempty"` // Details - Details about the payment method. Details *string `json:"details,omitempty"` // Expiration - Expiration date. @@ -1873,10 +1875,12 @@ func (p *Policy) UnmarshalJSON(body []byte) error { // PolicyProperties the properties of policy. type PolicyProperties struct { - // ReservationPurchasesAllowed - The reservationPurchasesAllowed flag. - ReservationPurchasesAllowed *bool `json:"reservationPurchasesAllowed,omitempty"` // MarketplacePurchasesAllowed - The marketplacePurchasesAllowed flag. MarketplacePurchasesAllowed *bool `json:"marketplacePurchasesAllowed,omitempty"` + // ReservationPurchasesAllowed - The reservationPurchasesAllowed flag. + ReservationPurchasesAllowed *bool `json:"reservationPurchasesAllowed,omitempty"` + // SubscriptionOwnerCanViewCharges - The subscriptionOwnerCanViewCharges flag. + SubscriptionOwnerCanViewCharges *bool `json:"subscriptionOwnerCanViewCharges,omitempty"` } // ProductDetails details of the product to be transferred. @@ -2252,8 +2256,8 @@ type ProfileProperties struct { DisplayName *string `json:"displayName,omitempty"` // PoNumber - Purchase order number. PoNumber *string `json:"poNumber,omitempty"` - // BillingAddress - Billing address. - BillingAddress *Address `json:"billingAddress,omitempty"` + // Address - Billing address. + Address *Address `json:"address,omitempty"` // InvoiceEmailOptIn - If the billing profile is opted in to receive invoices via email. InvoiceEmailOptIn *bool `json:"invoiceEmailOptIn,omitempty"` // IsClassic - Is OMS bootstrapped billing profile. @@ -2297,11 +2301,90 @@ func (future *ProfilesUpdateFuture) Result(client ProfilesClient) (p Profile, er return } -// Property the billing property. +// Property a billing property resource. type Property struct { autorest.Response `json:"-"` - // ProductID - Product Id. - ProductID *string `json:"productId,omitempty"` + // PropertySummary - A billing property. + *PropertySummary `json:"properties,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Property. +func (p Property) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.PropertySummary != nil { + objectMap["properties"] = p.PropertySummary + } + if p.ID != nil { + objectMap["id"] = p.ID + } + if p.Name != nil { + objectMap["name"] = p.Name + } + if p.Type != nil { + objectMap["type"] = p.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Property struct. +func (p *Property) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var propertySummary PropertySummary + err = json.Unmarshal(*v, &propertySummary) + if err != nil { + return err + } + p.PropertySummary = &propertySummary + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// PropertySummary the billing property. +type PropertySummary struct { // BillingTenantID - Billing tenant Id. BillingTenantID *string `json:"billingTenantId,omitempty"` // BillingAccountID - Billing account Id. @@ -2312,10 +2395,16 @@ type Property struct { BillingProfileID *string `json:"billingProfileId,omitempty"` // BillingProfileName - Billing profile name. BillingProfileName *string `json:"billingProfileName,omitempty"` + // CostCenter - Cost center name. + CostCenter *string `json:"costCenter,omitempty"` // InvoiceSectionID - Invoice Section Id. InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` // InvoiceSectionName - Invoice Section name. InvoiceSectionName *string `json:"invoiceSectionName,omitempty"` + // ProductID - Product Id. + ProductID *string `json:"productId,omitempty"` + // ProductName - Product name. + ProductName *string `json:"productName,omitempty"` // SkuID - SKU Id. SkuID *string `json:"skuId,omitempty"` // SkuDescription - SKU description. @@ -2824,12 +2913,14 @@ type SubscriptionProperties struct { LastMonthCharges *Amount `json:"lastMonthCharges,omitempty"` // MonthToDateCharges - Month to date charges. MonthToDateCharges *Amount `json:"monthToDateCharges,omitempty"` - // EnrollmentAccountContext - The enrollment account context. - EnrollmentAccountContext *EnrollmentAccountContext `json:"enrollmentAccountContext,omitempty"` // BillingProfileID - Billing Profile id to which this product belongs. BillingProfileID *string `json:"billingProfileId,omitempty"` // BillingProfileName - Billing Profile name to which this product belongs. BillingProfileName *string `json:"billingProfileName,omitempty"` + // InvoiceSectionID - Invoice section id to which this product belongs. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionName - Invoice section name to which this product belongs. + InvoiceSectionName *string `json:"invoiceSectionName,omitempty"` // SkuID - The sku id. SkuID *string `json:"skuId,omitempty"` // SkuDescription - The sku description. @@ -3330,6 +3421,8 @@ type TransactionsSummaryProperties struct { OrderID *string `json:"orderId,omitempty"` // OrderName - The reservation order name. OrderName *string `json:"orderName,omitempty"` + // ProductFamily - The product family. + ProductFamily *string `json:"productFamily,omitempty"` // ProductTypeID - The product type id. ProductTypeID *string `json:"productTypeId,omitempty"` // ProductType - The type of product. @@ -3397,8 +3490,8 @@ func (tbsr *TransferBillingSubscriptionRequest) UnmarshalJSON(body []byte) error // TransferBillingSubscriptionRequestProperties request parameters to transfer billing subscription. type TransferBillingSubscriptionRequestProperties struct { - // DestinationInvoiceSectionName - The destination invoiceSectionName. - DestinationInvoiceSectionName *string `json:"destinationInvoiceSectionName,omitempty"` + // DestinationInvoiceSectionID - The destination invoice section id. + DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` } // TransferBillingSubscriptionResult request parameters to transfer billing subscription. @@ -3635,8 +3728,8 @@ func NewTransferDetailsListResultPage(getNextPage func(context.Context, Transfer // TransferProductRequestProperties the properties of the product to initiate a transfer. type TransferProductRequestProperties struct { - // DestinationInvoiceSectionName - Destination invoice section id. - DestinationInvoiceSectionName *string `json:"destinationInvoiceSectionName,omitempty"` + // DestinationInvoiceSectionID - Destination invoice section id. + DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` } // TransferProperties transfer details diff --git a/services/preview/billing/mgmt/2018-11-01-preview/billing/subscriptionsbybillingprofile.go b/services/preview/billing/mgmt/2018-11-01-preview/billing/subscriptionsbybillingprofile.go index 5a0355ba188b..c484830e2cdf 100644 --- a/services/preview/billing/mgmt/2018-11-01-preview/billing/subscriptionsbybillingprofile.go +++ b/services/preview/billing/mgmt/2018-11-01-preview/billing/subscriptionsbybillingprofile.go @@ -93,7 +93,7 @@ func (client SubscriptionsByBillingProfileClient) ListPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfile/{billingProfileName}/billingSubscriptions", pathParameters), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }